WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW
IT COME ..
#include<stdio.h>
#include<conio.h>
void main()
{
int k=20;
printf("%d%d%d%d",k,k++,++k,k);
getch();
}
Answer Posted / dasari prasad
Output is 22 21 21 22
Because n printf evaluation starts from last parameter
because of STACK.. so calculate k value from last i.e k=20
and ++k=21 ,k++=21(post incre),k=22.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the difference between c &c++?
What is the significance of c program algorithms?
How can I use a preprocessorif expression to ?
Explain what are the different data types in c?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
What is floating point constants?
What is memcpy() function?
how do you programme Carrier Sense Multiple Access
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is ctrl c called?
How can a program be made to print the line number where an error occurs?
Can you please explain the difference between syntax vs logical error?
What are header files? What are their uses?
What is the deal on sprintf_s return value?