How does one code an application to repeat? My application functions fine but I need to have the program start from the beginning after it concludes. Their must be a command when I am by (return).
Code:
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
//Function Declaration
int main(int argc, char *argv[])
{
//Local Declarations
int a= 1; //First Integer
int b= 0; //Least Allowed Number
int x; //User inputted Number
int sum; //Sum of numbers multiplied
//Statements
printf("Input a Number:"); //User Instructions
scanf("%d", &x); //User inputs number
if (x >= b) //If statement
{
sum = x * a; //Number Multiplied by 1 and results
a = a+1;
printf("%d*1=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 2 and results
a = a+1;
printf("%d*2=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 3 and results
a = a+1;
printf("%d*3=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 4 and results
a = a+1;
printf("%d*4=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 5 and results
a = a+1;
printf("%d*5=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 6 and results
a = a+1;
printf("%d*6=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 7 and results
a = a+1;
printf("%d*7=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 8 and results
a = a+1;
printf("%d*8=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 9 and results
a = a+1;
printf("%d*9=%d\n\n", x, sum);
sum = x * a; //Number Multiplied by 10 and results
a = a+1;
printf("%d*10=%d\n\n", x, sum);
}
else //Closes program with Negative Integer
{
return 0;
}
system("PAUSE");
return 0;
}