#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
Is linux written in c?
What is ## preprocessor operator in c?
What is #include stdio h and #include conio h?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
Is c weakly typed?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is a substring in c?
How do you initialize pointer variables?
Is printf a keyword?
Is it possible to pass an entire structure to functions?
hi send me sample aptitude papers of cts?
Explain what are preprocessor directives?
What is a null pointer in c?
When should volatile modifier be used?