Soldato
- Joined
- 10 Apr 2004
- Posts
- 13,497
Code:
#include <stdio.h>
int main() {
/* declare a as a float variable */
float a, b;
/* print a prompt for the user */
printf("Please enter a number: ");
/* read the value entered into variable a */
scanf("%f",&a);
/* print a second prompt for the user */
printf("Please enter a second number:");
/* read the second value entered into variable b */
scanf("%f",&b);
/* print the value of a */
printf("You entered %f first:\n ",a);
/* print the value of b */
printf("You entered %f second:\n",b);
/* print the sum of a & b */
printf("The sum of the two values entered: %f\n",a+b);
/* print the difference of a & b */
printf("The difference of the two values entered: %f\n",b-a);
/* print the product of a & b */
printf("The product of the two values entered: %f\n",a*b);
/* print the quotient of a & b */
printf("The quotient of the two values entered: %f\n",a/b);
return(0);
}
Simple stuff for my Aero Eng course, but I'd like to be ahead of the game so how the hell do I loop (so I don't have to restart the app/terminal) everytime I complete a workflow?
Cheers
