Input and Output in C
Input : C supports a number of ways for taking user input. getchar() Returns the value of the next single character input. For example : #include <stdio.h> int main() { char a = getchar(); printf("You entered: %c", a); return 0; } The input is stored in the variable a. The gets() function is used to read input as an ordered sequence of characters, also called a string. A string is stored in a char array. For example : #include <stdio.h> int main() { char a[100]; gets(a); printf("You entered: %s", a); return 0; } Here we stored the input in an array of 100 characters. scanf() scans input that matches format specifiers. For example : #include <stdio.h> int main() { int a; printf("Please enter an element : ", a); scanf("%d", &a); return 0; } The " &" sign before the variable name is th...