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}
1#include <stdio.h>
2int main()
3{
4 int a;
5 float b;
6
7 printf("Enter integer and then a float: ");
8
9 // Taking multiple inputs
10 scanf("%d%f", &a, &b);
11
12 printf("You entered %d and %f", a, b);
13 return 0;
14}
1scanf("%d",&variable);
2
3/*
4% is a format specifier
5
6%d or %i for int
7%ld or %li for long int
8%f for float
9%lf for double
10%c for char
11%s for string
12*/
1#include <stdio.h>
2
3int main () {
4 scanf("%s", str);
5 printf("%s"str);
6 scanf("%d", int);
7 printf("%d"int);
8 return(0);
9}