Print Page | Close Window

can we call 'main' function recursively?

Printed From: One Stop GATE
Category: GATE AT A GLANCE
Forum Name: Correspondence Courses
Forum Discription: Discuss Correspondence Coaching provided by various institutions here before taking the decision to join one.
URL: http://forum.onestopgate.com/forum_posts.asp?TID=169
Printed Date: 07Feb2025 at 12:55pm


Topic: can we call 'main' function recursively?
Posted By: Vijay007
Subject: can we call 'main' function recursively?
Date Posted: 02Feb2007 at 5:21pm
Hi,

This id regarding two level-1 questions gven in Data Sttructures and and algorithms correspondence material.

Q 34 and Q 36

Q34] main()
{printf("GATE");
main();
}
And answer is Compiler error

Q36]
main()
{
statuc int a=3;
printf("%d",a--);
if (a)
main();
}
Answer given is 3 2 1

Anyone can you explain?

JAI HIND



Replies:
Posted By: balu
Date Posted: 23Feb2007 at 6:24pm
main() is used once in a function.....



Print Page | Close Window