#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 echo in c programming?
What is wrong with this statement? Myname = 'robin';
Is it cc or c in a letter?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
What is the use of define in c?
Hi can anyone tell what is a start up code?
Explain heap and queue.
What is the difference between c &c++?
What is a dynamic array in c?
How can I read a binary data file properly?
What is operator precedence?
What is pointer to pointer in c?
When should a type cast be used?
Write a progarm to find the length of string using switch case?
What is the -> in c?