C Programming :: Basic Concepts - Discussion
Home > C Programming > Basic Concepts > MCQs Questions Discussion
4 / 90
What will be the output of the below C program.
#include<stdio.h>
void main()
{
int i=400,j=300;
printf("%d..%d");
}
#include<stdio.h>
void main()
{
int i=400,j=300;
printf("%d..%d");
}
AGarbage Value
B400..300
CCompilation error
DNone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
C Language uses stack data structure for its variable memory allocation and it retrieves the values based on the LIFO principle. So here the output for the above code snippet is 300..400.
Read Full Answer
Report Error
Please Login First Click Here
STEP-BY-STEP
Here, in the printf() function we are printing 2 integer values, but we are not specifying what integer values we want to print. In this case, the printf() function takes garbage values and prints them.
Hence, option A is correct.
Read Full Answer
Report Error
Please Login First Click Here