Sail E0 Webinar
Question


What will be the output of the program in Turb C (under DOS)?


#include<stdio.h>
int main()
{
int arr[5], i=0;
while(i
Options:
A .  1, 2, 3, 4, 5,
B .  Garbage value, 1, 2, 3, 4,
C .  0, 1, 2, 3, 4,
D .  2, 3, 4, 5, 6,
Answer: Option B

Since C is a compiler dependent language, it may give different outputs at different platforms. 

We have given the TurboC Compiler (Windows) output.

Please try the above programs in Windows (Turbo-C Compiler) and Linux (GCC Compiler), 

you will understand the difference better.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers