Answer to Question #266732 in C for Gladys

Question #266732

Write a simple C program that accepts user input for the following:






Total number of test items, and percentage of correct answers. For every correct answer a






student gets five (5) points and loses two (2) points for every wrong answer.

1
Expert's answer
2021-11-16T07:44:47-0500


#include <stdio.h>


int main()
{
    int n,c;
    printf("Enter total number of items: ");
    scanf("%d",&n);
    printf("Enter the percentage of correct answers: ");
    scanf("%d",&c);
    int points=c*5;
    int loss=(n-c)*2;
    printf("Total earned points are: ");
    printf("%d",points);
    printf("\n");
    printf("Total points lossed are: ");
    printf("%d",loss);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS