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);


}




write the output of following code .. main() { static int a[]={10,20,30,40,50}; ..

Answer / 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

More C Interview Questions

When do you say that a digraph is acyclic A)if and only if its first search does not have back arcs B)a digraph is acyclic if and only if its first search does not have back vertices C)if and only if its first search does not have same dfnumber D)None of these

1 Answers   Accenture, IBM,


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


what is the use of keyword volatile??

4 Answers   LG Soft,


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers   CMC, Wipro,


How many main () function we can have in a project?

0 Answers  






how to find string length wihtout using c function?

6 Answers  


Write a program to print fibonacci series without using recursion?

0 Answers  


What are bit fields? What is their use?

2 Answers   Adobe,


What is the difference between a function and a method in c?

0 Answers  


How can I handle floating-point exceptions gracefully?

0 Answers  


Explain pointer. What are function pointers in C?

0 Answers   HCL,


Explain the difference between getch() and getche() in c?

0 Answers  


Categories