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}
1#include <stdio.h>
2
3int main () {
4 char str1[20], str2[30];
5
6 printf("Enter name: ");
7 scanf("%s", str1);
8
9 printf("Enter your website name: ");
10 scanf("%s", str2);
11
12 printf("Entered Name: %s\n", str1);
13 printf("Entered Website:%s", str2);
14
15 return(0);
16}