Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#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


Please Help Members By Posting Answers For Below Questions

Is c dynamically typed?

1093


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1073


How can a program be made to print the name of a source file where an error occurs?

1177


What is || operator and how does it function in a program?

1043


What is enumerated data type in c?

1033


Can a variable be both constant and volatile?

1046


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2415


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3290


What is anagram in c?

876


Why c is a procedural language?

1012


What does s c mean in text?

1057


Why is sprintf unsafe?

1001


In which layer of the network datastructure format change is done

1841


Explain the difference between getch() and getche() in c?

941


What is omp_num_threads?

1041