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
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
How do we declare variables in c?
Is int a keyword in c?
What is signed and unsigned?
What is the use of structure padding in c?
Can we access array using pointer in c language?
Does sprintf put null character?
Explain what are multidimensional arrays?
Explain what math functions are available for integers? For floating point?
What is the difference between local variable and global variable in c?
Explain the difference between null pointer and void pointer.
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
How are structure passing and returning implemented?
Is c easy to learn?
What is || operator and how does it function in a program?