void main()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
here in 3 6
Explanation:
The char array 'a' will hold the initialized string, whose
length will be counted from 0 till the null character. Hence
the 'I' will hold the value equal to 5, after the
pre-increment in the printf statement, the 6 will be printed.
| Is This Answer Correct ? | 18 Yes | 4 No |
Answer / ravneet kaur
as this is a character array and would have string in double
quotes so this code shows an error i.e. *char wont changes
to *int.
| Is This Answer Correct ? | 0 Yes | 5 No |
Design an implement of the inputs functions for event mode
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
How to reverse a String without using C functions ?
33 Answers Matrix, TCS, Wipro,
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(ā%dā, i); }
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,