#include void main(void) { /* The simple program that finds the sum of all numbers read up to a negative number using simple while structure */ float num, sum; /* initialize the control variable and ohters */ sum = 0; printf("please type the first number \t:"); scanf("%f", &num); /* test for loop continuation using control variable */ while (num >= 0) { sum += num; /* Now update the control variable */ printf("please type the next number \t:"); scanf("%f", &num); } printf("sum = %0.2f \n", sum); }