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 / vishwanath pillay

The answer will be :-

20, 21, 21, 21

At the start the value is initialized to 20.
since the line:-
printf("%d%d%d%d",k,k++,++k,k);
Answer:-- 20, 21, 21, 21

Is This Answer Correct ?    0 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to generate random numbers in c?

666


How can I recover the file name given an open stream or file descriptor?

600


Explain what are global variables and explain how do you declare them?

645


What are pointers? Why are they used?

632


What are the different types of control structures in programming?

661






Write programs for String Reversal & Palindrome check

601


What is strcmp in c?

603


Can include files be nested? How many levels deep can include files be nested?

660


What is ponter?

777


Explain the difference between structs and unions in c?

578


How can I write a function that takes a format string and a variable number of arguments?

608


why wipro wase

1834


What is main function in c?

551


Whats s or c mean?

597


Explain what is the use of a semicolon (;) at the end of every program statement?

740