C
Programming and Technical
Programming
Program
How many times the program will print "M4maths" ?
#include
int main()
{
printf("M4maths");
main();
return 0;
}
Options
1) Infinite times
2) 32767 times
3) 65535 times
4) Till stack overflows
Read Solution (Total 10)
-
- structures and unions in c program represents data abstraction.
A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it from the structure. A structure is a convenient way of grouping several pieces of related information together. so by the above description we can c program as abstraction.
- 12 years agoHelpfull: Yes(7) No(3)
- In C++, the classes used in the program will have a data abstraction.
- 12 years agoHelpfull: Yes(3) No(4)
- the printf statement repeats till the stack overflow....!
- 9 years agoHelpfull: Yes(1) No(0)
- the printf statement repeats till the stack overflow....!
it is self calling(recursive) function so every time as function gets called new runtime frame is created in runtime stack.
and as we all know memory is limited and max stack size is also restricted so as that size cross by our runtime stack then runtime error occur as Stack overflows..
so looping till stack overflows is final answer..
- 9 years agoHelpfull: Yes(1) No(0)
- it is recursive function
so M4maths prints infinite times
- 9 years agoHelpfull: Yes(1) No(0)
- till stack overflows
- 9 years agoHelpfull: Yes(0) No(0)
- infinite times bcoz main call by itself again and again
- 9 years agoHelpfull: Yes(0) No(0)
- 4)till stack overflows
- 6 years agoHelpfull: Yes(0) No(0)
- i think its answer is till stack overflows,but I am not sure ,anyone can tell correct answer
- 6 years agoHelpfull: Yes(0) No(0)
- option 4 is the right answer becoz i executed it in my system...it would be stopped till stack overflows
- 6 years agoHelpfull: Yes(0) No(0)
C Other Question