1#include <stdio.h>
2int main()
3{
4 char chr;
5 printf("Enter a character: ");
6 scanf("%c",&chr);
7 printf("You entered %c.", chr);
8 return 0;
9}
1#include <stdio.h>
2int main()
3{
4 int testInteger;
5 printf("Enter an integer: ");
6 scanf("%d", &testInteger);
7 printf("Number = %d",testInteger);
8 return 0;
9}
1Integer: Input: scanf("%d", &intVariable); Output: printf("%d", intVariable);
2Float: Input: scanf("%f", &floatVariable); Output: printf("%f", floatVariable);
3Character: Input: scanf("%c", &charVariable); Output: printf("%c", charVariable);
1#include <stdio.h>
2//this is for entering and storing strings
3int main(){
4 char name[20];
5
6 printf("Enter a name : ");
7 scanf("%s", &name);
8
9 printf("the name entered is: %s\n", name);
10
11
12
13return 0;
14}