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 a[4]="HELLO"; printf("%s",a); }
WAP to display 1,2,3,4,5........N
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number
main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
how to check whether a linked list is circular.
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }