Input Output – Let us C https://c.praveshagrawal.com Example C Programs Sat, 02 Dec 2023 11:27:09 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 Character Input and Output https://c.praveshagrawal.com/2023/12/02/character-input-and-output/ https://c.praveshagrawal.com/2023/12/02/character-input-and-output/#respond Sat, 02 Dec 2023 11:27:09 +0000 https://c.praveshagrawal.com/?p=133 #include <stdio.h> int main() { // Character input and output char ch; printf("Enter a character: "); scanf(" %c", &ch); // Note the space before %c to consume any leading whitespace printf("You entered: %c\n", ch); return 0; } ]]> https://c.praveshagrawal.com/2023/12/02/character-input-and-output/feed/ 0 Multiple Inputs and Outputs https://c.praveshagrawal.com/2023/12/02/multiple-inputs-and-outputs/ https://c.praveshagrawal.com/2023/12/02/multiple-inputs-and-outputs/#respond Sat, 02 Dec 2023 11:26:48 +0000 https://c.praveshagrawal.com/?p=131 #include <stdio.h> int main() { // Multiple inputs and outputs int num1, num2, sum; printf("Enter two integers: "); scanf("%d %d", &num1, &num2); sum = num1 + num2; printf("Sum: %d\n", sum); return 0; } ]]> https://c.praveshagrawal.com/2023/12/02/multiple-inputs-and-outputs/feed/ 0 String Input and Output https://c.praveshagrawal.com/2023/12/02/string-input-and-output-2/ https://c.praveshagrawal.com/2023/12/02/string-input-and-output-2/#respond Sat, 02 Dec 2023 11:26:28 +0000 https://c.praveshagrawal.com/?p=126 #include <stdio.h> int main() { // String input and output char name[50]; printf("Enter your name: "); scanf("%s", name); printf("Hello, %s!\n", name); return 0; } ]]> https://c.praveshagrawal.com/2023/12/02/string-input-and-output-2/feed/ 0 Input and Output with Floating-Point Numbers https://c.praveshagrawal.com/2023/12/02/input-and-output-with-floating-point-numbers/ https://c.praveshagrawal.com/2023/12/02/input-and-output-with-floating-point-numbers/#respond Sat, 02 Dec 2023 11:26:13 +0000 https://c.praveshagrawal.com/?p=127 #include <stdio.h> int main() { // Input and output with floating-point numbers float floatNumber; printf("Enter a floating-point number: "); scanf("%f", &floatNumber); printf("You entered: %f\n", floatNumber); return 0; } ]]> https://c.praveshagrawal.com/2023/12/02/input-and-output-with-floating-point-numbers/feed/ 0 Simple Input and Output https://c.praveshagrawal.com/2023/12/01/demonstrate-input-output/ https://c.praveshagrawal.com/2023/12/01/demonstrate-input-output/#respond Fri, 01 Dec 2023 14:09:39 +0000 https://c.praveshagrawal.com/?p=35 #include <stdio.h> int main() { // Simple input and output int number; printf("Enter an integer: "); scanf("%d", &number); printf("You entered: %d\n", number); return 0; } ]]> https://c.praveshagrawal.com/2023/12/01/demonstrate-input-output/feed/ 0