varalamahesh
Programmer
- Jul 7, 2012
- 20
exit*(;
should have a prototype?
please provide this...
should have a prototype?
please provide this...
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <stdlib.h>
...
exit(0); /* normal exit */
/* or */
exit(status_code); /* int status_code != 0 - abnormal termination. */
#include <stdio.h>
#include <stdlib.h> /* INCLUDE THIS HEADER FILE */
int main()
{
int goals;
printf("\nEnter no of goals scored against india: ");
scanf("%d",&goals);
printf("\nYou entered %d\n\n", goals);
if (goals <= 5)
{
printf("to err is human!\n\n");
exit(1);
}
printf("About time soccer players learned C.\n");
printf("and said goodbye! adieu! to soccer\n\n");
exit(0); /*terminate programme excution*/
}
while(another=='y')
{
main()
}
int nain(void) /* that's (one of) correct main in C */
{
...
if (scanf("%d",&goals) != 1) {
printf("Sorry, a number expected...\n");
return 1;
}
...
}
for(;;) { // We can see the loop started here...
input;
switch (...) {
case 1: Output1; break;
case 2: Output2; break;
case 3: Output3; continue; // We can see the next round...
case 4: Output4; break;
default: ????... // Never use switch w/o default label...
}
break;
}