To specify 3.14 as long double, we have to add L to the 3.14. (i.e 3.14L)
#include<stdio.h> int main() { int i; printf("%d\n", scanf("%d", &i)); return 0; }
printf("%d\n", scanf("%d", &i)); The scanf function returns the value 1(one).
Therefore, the output of the program is '1'.
int *ptr[30];
#include<stdio.h> int main() { char huge *near *far *ptr1; char near *far *huge *ptr2; char far *huge *near *ptr3; printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3)); return 0; }
#include<stdio.h> int main() { struct node { int data; struct node *link; }; struct node *p, *q; p = (struct node *) malloc(sizeof(struct node)); q = (struct node *) malloc(sizeof(struct node)); printf("%d, %d\n", sizeof(p), sizeof(q)); return 0; }
After sometime the stack memory will be filled completely. Hence stack overflow error will occur.
#include<stdio.h> int main() { int arr[] = {12, 13, 14, 15, 16}; printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0])); return 0; }
void *cmp();
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.