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


Please Help Members By Posting Answers For Below Questions

What math functions are available for integers? For floating point?

625


can anyone suggest some site name..where i can get some good data structure puzzles???

1643


Which built-in library function can be used to match a patter from the string?

747


How does free() know explain how much memory to release?

621


What are file streams?

572






What is %d used for?

585


Explain About fork()?

648


What is variables in c?

609


What is a rvalue?

751


Can we declare variables anywhere in c?

580


What is sizeof c?

609


What is the use of a conditional inclusion statement in C?

602


What do you mean by scope of a variable in c?

546


What are the functions to open and close the file in c language?

595


Is exit(status) truly equivalent to returning the same status from main?

587