Answer to Question #267996 in C for mkl

Question #267996

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

The total number of test items, and the 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-18T15:17:25-0500


#include <stdio.h>




int main()
{
    int x,m;
    printf("Input total number of items: ");
    scanf("%d",&x);
    printf("Enter the percentage of correct answers: ");
    scanf("%d",&m);
    int P=m*5;
    int L=(x-m)*2;
    printf("Total earned points are: ");
    printf("%d",P);
    printf("\n");
    printf("Total points lossed are: ");
    printf("%d",L);
    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