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 does the file stdio.h contain?

0 Answers  


why java is called as a purely oops language.

3 Answers   TVS,


What are derived data types in c?

0 Answers  


What is void main ()?

0 Answers  


How can I pad a string to a known length?

0 Answers  


Write a program to know whether the input number is an armstrong number.

0 Answers   Wipro,


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 Answers  


How are strings stored in c?

0 Answers  


Explain what are the standard predefined macros?

0 Answers  


write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


Write a program to show the workingof auto variable.

2 Answers   Infotech,


Is a pointer a kind of array?

0 Answers  


Categories