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;
}
}
Answer Posted / 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 |
Post New Answer View All Answers
Explain what are the advantages and disadvantages of a heap?
What is keyword in c?
How is a macro different from a function?
Explain how can you avoid including a header more than once?
What is #include conio h?
What is a static function in c?
Explain what does it mean when a pointer is used in an if statement?
Which one would you prefer - a macro or a function?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
Why main is not a keyword in c?
Can the “if” function be used in comparing strings?
What are pointers?
What is static and auto variables in c?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
How can I invoke another program or command and trap its output?