1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 | #include<stdio.h>
#define limit 40
int main () {
char c;
char s1[] = "Nahid",s4[]={'H','a','s','a','n','\0'},s[limit]; //\0 use na korle repeat hoy
int i,i2,n;
int a[limit];
float f;
double d;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
/*FILE *fptr;
fptr = (fopen("C:\\student.txt", "w"));
fprintf(fptr,"\nName: %s \nMarks=%d \n", name, marks);*/
// \0 is zero character. In C it is mostly used to indicate the termination of a character string.
printf("Enter character\n");
scanf("%c",&c);
printf("its a character type data %c\n",c);
printf("Enter string: last name\n ");
scanf("%[^\n]s",s); /**full string also by %[^\n]%*c*/
printf("\nits string type data %s %s %s\n",s1,s4,s);
printf("Enter integer\n");
scanf("%d%n",&i,&n);
printf("entered number %d\ncounted number is %d\n",i,n);//n-input number
printf("Enter array\n");
scanf("%d",&a);
printf("its an array type data %d\n",a);
printf("Enter double\n");
scanf("%lf",&d);
printf("its double type data %.4lf",d);
scanf("%f",&f);
printf("its float type data %.2f",f);
} |
Comments
Post a Comment