#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 / sudhir kumar sharma

if we try this program in case of above program we will come
to a conclusion that all the variable declared before main
are global and assigned a value by default to zero that's
why the while loop will not executed in the above program :)
#include<stdio.h>
#include<conio.h>
int a;
float b;
double c;
char d;
static int e;

int main()
{
clrscr();
printf("%d\n %f\n %d\n %c\n %d\n",a,b,c,d,e);
getch();
return 0;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State the difference between realloc and free.

636


What does & mean in scanf?

604


Can stdout be forced to print somewhere other than the screen?

627


What is an endless loop?

804


Tell me about low level programming languages.

645






How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15507


Explain how do you sort filenames in a directory?

609


Explain what does the function toupper() do?

637


How can a process change an environment variable in its caller?

656


What is New modifiers?

672


Where is c used?

652


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1664


Can we assign string to char pointer?

589


If I have a char * variable pointing to the name of a function ..

654


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

679