Huawei
Company
Programming
Definition
main()
{
int a=5;
if(a=0)
{
return;
}
printf("%d",a);
main()
}
Read Solution (Total 9)
-
- it will execute until overflow occur in the memory stack
because at last main function is there.when the main function is executed It will forward to the previous main() function.
This process will continue. - 10 years agoHelpfull: Yes(11) No(1)
- Error ,invalid assignement in if().
- 10 years agoHelpfull: Yes(5) No(7)
- It executes till stack overflows
- 10 years agoHelpfull: Yes(3) No(0)
- error. second main has no semicolon.
- 10 years agoHelpfull: Yes(3) No(3)
- error as if(a=0) we can set only boolean values for if ..it must be if(a==0) hence it will show invalid assigment
- 9 years agoHelpfull: Yes(3) No(1)
- Error saying....
In function 'main':
Line 10: error: expected ';' before '}' token
if below main function would have ; then it will give output till stack overflow. - 8 years agoHelpfull: Yes(2) No(0)
- ans: infinte
- 10 years agoHelpfull: Yes(1) No(1)
- 5 will be printed infinite times..
- 9 years agoHelpfull: Yes(0) No(3)
- since a=0 is an assigned.
The program will print 0000000000.......... until and overflow in memory.
I Have also tried executing the program. - 7 years agoHelpfull: Yes(0) No(0)
Huawei Other Question