Computer Science, asked by manviyadav93, 18 days ago

Q17. Write the output of the following programs? Input "Enter score=",sc If sc>=80 then Print "You have won a school bag" Else If sc>=70 then Print "You have won a pizza" Else If sc>=60 then Print "You have won a movie ticket" Else Print "Try again" if sc=95.Write the output?​

Attachments:

Answers

Answered by LegendaryEagle
1

Answer:

#include <stdio.h>

int main(void)

{

   int sc;

   

  printf("Enter your score");

  scanf("%d", &sc);

   if (sc >= 80) {

       printf("You have won a school bag");

   }  else if (sc >= 70) {

       printf("You have won pizza");

   }  else if (sc >= 60) {

       printf("You have won a movie ticket");

   }  else {

       printf("Try again");

  }

 return 0;

}

Similar questions