write the output of following code ..
main()
{
static int a[]={10,20,30,40,50};
int *ptr=a;
static int arr[2][2]={1,2,3,4};
char str[]="ABCD * 4#";
char *s=str+2;
int i,j;
for(i=0;i<5,i++)
printf("%d",*ptr++);
for(i=0;i<2;i++)
for(j=0;j<2;j++)
printf("%d\n",*(*(n+i)+j));
printf("%c\n%c\n%c\n",*(str+2),*s++,*--s);
}
Answer Posted / pramod
There is a compilation error in the line.
printf("%d\n",*(*(n+i)+j)); as n is not defined. If we
assume arr in place of n then the output is:
10203040501
2
3
4
C
B
B
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is a example of a variable?
How do you print only part of a string?
Is void a keyword in c?
What are dangling pointers in c?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Is c object oriented?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
How can I rethow can I return a sequence of random numbers which dont repeat at all?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What is anagram in c?
What is the use of extern in c?
Can two or more operators such as and be combined in a single line of program code?
How is a macro different from a function?
What is main return c?
What is the Purpose of 'extern' keyword in a function declaration?