main()
{
char *str1="abcd";
char str2[]="abcd";
printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));
}
Answer / susie
Answer :
2 5 5
Explanation:
In first sizeof, str1 is a character pointer so it gives you
the size of the pointer variable. In second sizeof the name
str2 indicates the name of the array whose size is 5
(including the '\0' termination character). The third sizeof
is similar to the second one.
| Is This Answer Correct ? | 14 Yes | 3 No |
main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
why is printf("%d %d %d",i++,--i,i--);
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
How can i find first 5 natural Numbers without using any loop in c language????????
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
Derive expression for converting RGB color parameters to HSV values
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above