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 / robin
different compiler gives different ans..
this is for tc
but its true it work as stack
last in first out
value of k is store in stack
1. k = 20
2. ++k = 21 (Pre Increment )
3. k++ = 21 (Post Increment(k value now is 22))
4. k = 22
As 22 is last it is printed 1st.........
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Is a house a shell structure?
write an algorithm to display a square matrix.
What is the basic structure of c?
What is structure in c language?
can we have joblib in a proc ?
What is break in c?
Is c is a middle level language?
How can I get the current date or time of day in a c program?
What are identifiers in c?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Write a program to check palindrome number in c programming?
What is the difference between NULL and NUL?
The __________ attribute is used to announce variables based on definitions of columns in a table?
Is it possible to have a function as a parameter in another function?
What are the different types of constants?