Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the output of the following program?
main()
{
int c[]={2,8,3,4,4,6,7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
{
printf("%d",*c);
++q;
}
for(j=0;j<5;j++)
{
printf("%d",*p);
++p;
}
}

Answers were Sorted based on User's Feedback



what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q..

Answer / praveen

2222228344

Is This Answer Correct ?    8 Yes 0 No

what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q..

Answer / vignesh1988i

2222228344...

the above code can be remodified as :
printf("%d",*q); in first printf statement to get the same
output for both printf statements



thank u

Is This Answer Correct ?    2 Yes 0 No

what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q..

Answer / ashwin kumar

output is 2222228344


in loop 1

as we know that array variable contain the base address of
the array

*c means we are trying to print the value of contained in
the base address which is not changed in the loop

note we can't change the base address of the array that is
we can't do 'c++'

as in loop for 5 times contain of the base address will be
printed as
22222



in loop 2

in assigned base address of the array to pointer p

here we are printing the contain of address stored in p and
increment the value of p ( that is pointing to the next
element of the array )

so we will get output for 2nd loop is

28344


overall answer is

2222228344

if any wroung in my aswer plz info me at

molugu.ashwin@gamil.com

Is This Answer Correct ?    2 Yes 0 No

what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q..

Answer / abhradeep chatterjee

2222228344 will be the answer. I think everybody answered
before me is correct.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

What is the explanation for modular programming?

0 Answers  


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

3 Answers   Infosys,


How to explain the final year project as a fresher please answer with sample project

0 Answers  


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

0 Answers   XYZ,


How will you find a duplicate number in a array without negating the nos ?

0 Answers  


What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);

3 Answers   Bosch,


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

8 Answers   Aspire,


why TCS selected more student in the software field from all institution.

5 Answers   TCS,


What is wrong with this program statement?

0 Answers  


what is use of loop?

10 Answers   Infosys,


Using which language Test cases are added in .ptu file of RTRT unit testing???

0 Answers  


#&#8206;include&#8236;<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }

2 Answers   Facebook,


Categories