#include<stdio.h>
int fun();
int i;
int main()
{
while(i)
{
fun();
main();
}
printf("hello \n");
return 0;
}
int fun()
{
printf("hi");
}
answer is hello.how??wat is tat while(i) mean?
Answer Posted / vignesh1988i
see first of all variable 'i' is declared as a global
storage class variable .. so according to that storage class
whenever we define an variable i before the main function
and explicatily we haven't initilized that variable means it
will defaultly variable i will have 0....
so when this while is compiled i has 0 which makes the loop
false.. so it will compile the very first statement after
that loop... so it prints hello...........
thank u
| Is This Answer Correct ? | 18 Yes | 0 No |
Post New Answer View All Answers
What is extern c used for?
What is an arrays?
By using C language input a date into it and if it is right?
Why c is called a mid level programming language?
How is pointer initialized in c?
Explain what happens if you free a pointer twice?
What does c value mean?
What is use of bit field?
What are the application of void data type in c?
What is the maximum length of an identifier?
What is the best organizational structure?
largest Of three Number using without if condition?
Does c have an equivalent to pascals with statement?
Tell us two differences between new () and malloc ()?
What does c mean?