What is the output for the following code??(C Language) | SoloLearn: Learn to code for FREE!

0

What is the output for the following code??(C Language)

#include<conio.h> #include<stdio.h> int i; void fun() { printf("Hi"); } void main() { while(i) { fun(); main(); } printf("Hello\n"); }

1/21/2018 12:47:29 PM

Ricky Robert

6 Answers

New Answer

+13

Output is "Hello". Even though 'i' was not initialized in code, it is global so it will be 0.

+12

Next time include this 😏 https://www.sololearn.com/discuss/288609/?ref=app

+7

@kurwius did you compile that with C++?

+3

i is not initialized