#include <stdio.h>
void main()
{
int I, N=0;
float number,sum=0, number1;
printf("How many numbers do you want to add:");
scanf("%d",&N);
N=N-1;
for (I=1; I<=N; I++)
{
printf("PLease Enter The Biggest Number To Be SubTract");
scanf("%f",&number1);
printf("Please enter number %d:", I);
scanf("%f",&number);
sum = number1 - number;
}
printf("Total = %.2f\n",sum);
}
I hvae try searching but could not find can anyone of ur help me to do a subtract >.< Thanks :)
Hm.. i onli wan to do a subtract of a loop but i onli gt addition and could not get subtraction of a loop.........
the output of this should be like this:How many numbers do you want to subtract: 3
Please enter number 1: 12
Please enter number 2: 2.5
Please enter number 3: 0.25
12 - 2.5 - 0.25 = 9.25
printf("PLease Enter The Biggest Number To Be SubTract");
scanf("%f",&sum);
for (I=1; I<=N; I++)
{
printf("Please enter number %d:", I);
scanf("%f",&number);
sum = sum - number;
}
printf("Total = %.2f\n",sum);