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 –
no one can defeat you in teaching programming. thank you.
#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”);
}
}
@Sumit Baghel bro Apna what’s app de
@Sumit Baghel bro Apna what’s app de
@Sumit Baghel bro Apna what’s app de
@Sumit Baghel mai bhi start kiya hun c programming
@Sumit Baghel thoda experience batayenge aap 2 saal pehle c seekhe the…. Please kuch bataiye
Sir you deserve a million of subscriber ❤
He has now
He got
Now he has ??
No sir you deserve 100 million subscribe
now, our harry bhai is near to 2 M subscribers
Challenge accepted??
@47.Shivank Tiwari whatspp num do usme bhjta hu
@Ayush Bisht toh bhai code toh bata do
@47.Shivank Tiwari mera bngya ab
bro then pl tell the programm
Program bna?
#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”);
}
}
Why to add == in if(a==1)
Int a ke baad jo do line likha hai aapne wo accha nhi hai.
Bhai jo upar ka dono satement hai use ek hi me likho varna user confused ho jaega agar usne dono exam pass kiya hoga to
bhai return ni karwau value aapne
Thanks, bro! It’s working.
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;
}
literally these free educational videos are bringing back the main essence of education: “Available to all and no price to pay”
Bro please teach algorithm and it’s flowchart. Its a request….
You teach very well.. Thank you for guidance
Challenge accepted and even got correct output ?
1 more point to note that condition is given as relational expression
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.
I am a 13y/o but still I am able to learn C from this playlist of code with harry. Thanks?
@EEE-0021 Sarthak Choudhury Why is it not for them?
Its definitely more productive than doing homework.
i am 8 yrs
I had born yesterday.
@Mahendra singh rawat i am not born and completed in womb ??
Challenge accepted sir .thank you very much for your guidance.
Beautifully explained ???
Sir explanation ever . U deserve millions of subscribers and thank u very much for giving us such a good explanation . Love from Hyderabad
You are too best ? and your way of explain and to communicate is also superb ☺️
And the main thing is, this amazing course is free
Thank you So Much Harry Sir.
Sir, i saw 3-4 videos of C programming.AWESOME TEACHING. But sir, i want notes of C programming.
Thank You
Hope you are enjoying this course guys?
Like aur Share karna mat bhoolna 🙂
@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;
}
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;
}
@Inoxent Abubakar super
@Inoxent Abubakar Great Work!
Thank you very much sir for giving me this information about if ,else statement . you way of teaching is very good ❤?❤?
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”);}
}