Computer Science, asked by rajbirkaur14403, 9 months ago

in a competitive examination,there were 150 questions.one candidate got 80% correct and the other candidate 72% correct.write a program to calculate and display the correct answers each candidate got.​

Answers

Answered by Anonymous
11

Answer:

I)120 ii)108

Explanation:

  1. we know there are 150 questions out of which one candidate got 80% correct answer so the first candidate got total correct answer is equal to 80% of 150 i.e. 80 X 150 divided by 100 show the answer got is 120.
  2. the second candidate got 72% so total correct answers he have done is 72 X 150 divided by hundred. so the answer is he got is 108. hope it's help you.
Answered by factrahulbiswas
7

Explanation:

public class KboatCompetitiveExam

{

public static void main(String args[]) {

int totalQuestions = 150;

int c1 = (int)(80 / 100.0 * totalQuestions);

int c2 = (int)(72 / 100.0 * totalQuestions);

System.out.println("Correct Answers of Candidate 1 = " + c1);

System.out.println("Correct Answers of Candidate 2 = " + c2);

}

}

HOPE IT SEEMS TO BE USE FULL.

Similar questions