Login

Lost your password?
Don't have an account? Sign Up

If Else Control Statements In C: C Tutorial In Hindi #10

In this c programming tutorial video, I have explained you about if else conditionals in c and examples of the same in c. I hope you are enjoying this C course in Hindi.
►This C Lecture is a part of this C Programming Course:
►Source Code + Notes:
►Click here to subscribe –

Best Hindi Videos For Learning Programming:

►Learn Python In One Video –

►Learn JavaScript in One Video –

►Learn PHP In One Video –

►Machine Learning Using Python –

►Creating & Hosting A Website (Tech Blog) Using Python –

►Advanced Python Tutorials –

►Object Oriented Programming In Python –

►Python Data Science and Big Data Tutorials –

Follow Me On Social Media
►Website (created using Flask) –
►Facebook –
►Instagram –
►Personal Facebook A/c –
Twitter –

https://www.educational.guru

48 comments

  1. Sumit Baghel

    #include
    int main()
    {
    int a;
    printf(“Enter How many Subject you passedn”);
    printf(“Enter 1 if you passed mathsn”);
    printf(“Enter 2 if you passed sciencen”);
    printf(“Enter 3 if you passed both math and sciencen”);
    scanf(“%d”,&a);
    if(a==3)
    {
    printf(“Congratulations You won Rs.45”);

    }
    else if(a==2||a==1)
    {
    printf(“Congratulations You won Rs.15”);

    }
    else
    {
    printf(“Sorry You don’t won anithing”);
    }

    }

  2. Md Imran Nazir

    #include
    int main()
    {
    int a;
    printf(“Enter 1 if you passed math or science only n”);
    printf(“Enter 2 if you passed both n”);
    scanf(“%d”,&a);
    if (a==1)
    {
    printf(“You get 15rs”);
    }
    else if (a==2)
    {
    printf(“You get 45rs”);
    }
    else
    {
    printf(“No gift for u”);
    }

    }

  3. KDG_YT

    For them who are facing problem
    #include
    int main ()
    {
    int examcode ;
    printf(“Enter the code of exam which you have passedn”);
    printf(“For science the code is 1. n”);
    printf(“For maths the code is 2. n”);
    printf(“For science and maths the code is 3. n”);
    scanf(“%d”,&examcode);
    printf(“The code you had entered is %d n”,examcode);

    if(examcode==1){
    printf(“You had won 15 rupees for passing the science exam.”);
    }
    else if(examcode==2){
    printf(“You had won 15 rupees for passing the maths exam.”);
    }
    else if(examcode==3){
    printf(“You had won 45 rupees for passing the maths and science exam both.”);
    }

    return 0;
    }

  4. D k Patel

    A switch statement tests the value of a variable and compares it with multiple cases. Once the case match is found, a block of statements associated with that particular case is executed. Each casein a block of a switch has a different name/number which is referred to as an identifier.

    1. रोहित Ilame

      @rahil badi #include

      int main(){

      int gift;

      printf(“Enter of the subject you passedn”);
      printf(“1 only mathn”);
      printf(“2 only sciencen”);
      printf(“3 both math and sciencen”);

      scanf(“%d”, &gift);

      if(gift==1){
      printf(“Your gift is a 15 rupees you passed mathn”);
      }
      if(gift==2){
      printf(“Your gift is a 15 rupees you passed sciencen”);
      }
      if(gift==3){
      printf(“Your gift is a 45 rupees you passed both science and mathn”);
      }
      else
      {
      printf(“You enter wrong numbern”);
      }
      return 0;

      }

    2. Sheilendra Singh

      Challenge accepted
      #include
      #include

      int main()
      {
      int M,S;
      printf(“enter your marks of maths :”);

      scanf(“%d”,&M);
      printf(“enter your marks of science :”);

      scanf(“%d”,&S);

      printf(“your marks isn”);
      printf(“maths=%d/100n”,M);
      printf(“science=%d/100n”,S);

      if(M>=33,S>=33)
      {
      printf(“you have passed in both subjects.n”);
      printf(“you will have gift worth rs. 45/-.”);
      }
      else if(M>=33,S<33)
      {
      printf("you have passed in only maths.n");
      printf("you will have gift worth rs. 15/-.");
      }
      else if(M<33,S>=33)
      {
      printf(“you ahve passed in only science.n”);
      printf(“you will have gift worth rs. 15/-.”);
      }
      else
      {
      printf(“you haven’t passed.”);
      }

      return 0;
      }

  5. RAHUL PARIHAR

    Challenge accepted ?
    #include
    void main()
    {
    int mathematics, science;
    printf(“enter the no. of mathematics=”);
    scanf(“%d”,&mathematics);
    if(mathematics>=30)
    printf(“congratulations,your pass in mathematics n”);
    else
    (“you are failed in mathematics n”);
    printf(“enter the no. of science=”);
    scanf(“%d”,&science);
    if(science>=30)
    printf(“congratulations,your pass in science n”);
    else
    printf(“you are failed in science n”);

    if(mathematics>=30 && science>=30)
    { printf(“great you got 45 rs cash prize n”);}
    else if(mathematics>=30 && science<=30) { printf("good you got 15 rs. pen n");} else if(mathematics<=30 && science>=30)
    { printf(“good you got 15 rs cash prize n”);}
    else
    { printf(“you are failed”);}
    }

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*