Code a program to get an unknown number of test percentages from the user. Accept percentages until the user enter a percentage of -99. This number ( -99) indicates the end of the data and must not be used as part of the calculations.
#include <stdio.h>
#include<stdbool.h>
int main(void) {
int p;
while(true)
{
printf("Enter a percentage: ");
scanf("%d",&p);
if(p==-99){
break;
}
}
return 0;
}
Comments
Leave a comment