-1

#include <stdio.h>
// Please help me I am unable to get the problem
int main()
{ char a;
printf("which subject you have passed?\n 1.Maths\n 2.Science\n 3.Both maths and science\n");
scanf("%d", &a);

if (a=1) {
printf("You will get 20 rupees");}
else if (a=2) {
printf("You will get 20 rupees");}
else (a=3) {
printf("You will get 50 rupees");}
}

Comments
  • 0
    Learn comparison operators
  • -1
    @kanchasohail can you refine your query and use search engine instead? It's the most crucial skill in our century. It will save you lots of pain.

    We don't want this to be a question-answer website, but have valuable discussions, not trivialities like this.

    https://lmddgtfy.net//...
  • 1
  • 0
    @GeorgeBool ok thanks bro
  • 0
    @GeorgeBool will you please execute the problem in your c terminal and check what is the exact problem??
  • 0
    @GeorgeBool he said that the person who passed only maths exam will get 15 rupees
    And if he passed only science exam he will get 15 rupees
    And if he passed both exams he will get 45 rupees

    He told us to program this in c
Add Comment