First Exercise
#include <cstdio>
int main()
{
int number = 0;
int number2 = 0;
int sumofnumber = 0;
int xofnumber = 0;
float divideofnumber = 0;
printf("Put a number in here!");
scanf("%d", &number);
fflush(stdin);
printf("Put another number in here!");
scanf("%d", &number2);
fflush(stdin);
printf("I got the numbers %d and %d!\n", number, number2);
sumofnumber = number+number2;
printf("The sum of your two numbers is %d!\n", sumofnumber);
xofnumber = number * number2;
printf("The product of your two numbers is %d!\n", xofnumber);
divideofnumber = ((float)number / (float)number2);
printf("The division of your two numbers is %10.10f!\n", divideofnumber);
scanf("*");
return 0;
}
This is the first exercise which Jackson asked us to do with a few added bits. How do i clear the screen after the user has input the two numbers.