1#include <stdio.h>
2
3int main()
4{
5 int a, b, c;
6 printf("Enter the first value:");
7 scanf("%d", &a);
8 printf("Enter the second value:");
9 scanf("%d", &b);
10 c = a + b;
11 printf("%d + %d = %d\n", a, b, c);
12 return 0;
13}
14
1/* scanf example */
2#include <stdio.h>
3
4int main ()
5{
6 char str [80];
7 int i;
8
9 printf ("Enter your family name: ");
10 scanf ("%79s",str);
11 printf ("Enter your age: ");
12 scanf ("%d",&i);
13 printf ("Mr. %s , %d years old.\n",str,i);
14 printf ("Enter a hexadecimal number: ");
15 scanf ("%x",&i);
16 printf ("You have entered %#x (%d).\n",i,i);
17
18 return 0;
19}
1#include <stdio.h>
2int main(){
3int x1,x2,x3,x4,x5;
4 float mean;
5 printf(“Input 5 Number::”);
6 scanf(“%d %d %d %d %d”,&x1,&x2,&x3,&x4,&x5);
7 mean=(x1+x2+x3+x4+x5)/5;
8 printf(“%.3f”,mean);
9 getche();
10}