Hi!!,
I wanted to know if i could call the main () function within itself as shown,
#include <stdio.h>
main ()
{
int a,b,c;
char ans;
printf ("Enter the first number : \n");
scanf ("%d", &a);
printf ("Enter the second number : \n");
scanf ("%d", &b);
c=a+b;
printf ("The total is :%d", c);
printf ("Do you want to continue ?y/n\n");
scanf ("%c", &ans);
if (ans=="y")
{
main ();
}
else if (ans=="n")
{
exit ();
}
}
I wanted to know if this could be done.