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

preview_player
Показать описание
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.

Best Hindi Videos For Learning Programming:

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

Hope you are enjoying this course guys?
Like aur Share karna mat bhoolna :)

CodeWithHarry
Автор

int main() {
int subject;
printf("enter 1 for science\n");
printf("enter 2 for maths\n");
printf("enter 3 for both");
printf("enter your subject number :");
scanf("%d", &subject);
if (subject==1 || subject==2) {
printf("your gift is of $15");
}
else if(subject==3) {
printf("your gift is of $45");
}
else {
printf("enter a valid subject number and try again");
}
return 0;
}

harshitrao
Автор

#include<stdio.h>
int main() {
int a;
printf("1 means passed in maths or science\n2 means passed in both\n3 means failed");
printf("\nEnter:");
scanf("%d", &a);
if (a==1) {
printf("prize is 15");
}
else if (a==2) {
printf("prize is 45");
}
else {
printf ("failed");

}
return 0;
}

NaachMore
Автор

no one can defeat you in teaching programming. thank you.

crcbheskatri
Автор

Sir you deserve a million of subscriber ❤

purabsinghhh
Автор

भाई आपका पढ़ाने का तरीका बहुत ही अच्छा है ।
हम आपका किस तरह से शुक्रिया अदा करे 🙏🙏

aditya._.official
Автор

Hello harry, You are doing very well. I have not seen C so simple ever. You made it so simple to learn. You are doing such a amazing work for students and people who want to clear their concept using your tutorial. I am technical Engineer in govt job. i was trying to learn C from last one year for making good logical program and want to learn to burn this program on arduino board.

But always getting confused. You have made my mind so simple to learn C and make me crazy to learn more & more. Keep it up harry bro. All you have presented in desi bhasha which shows that a friend is teaching us. You are such a real hero. From my side you are a nobel prize

pksingh
Автор

#include<stdio.h>
int main(){
int subject;
printf("Which subject did you passed\n"
"1.Maths & Science\n"
"2.Science\n"
"3.Maths\n");
scanf("%d", &subject);
if (subject==1)
{
printf("CONGRATS! Your prize is 45");
}
else if (subject==2)
{
printf("CONGRATS! Your prize is 15");
}
else if (subject==3)
{
printf("CONGRATS! Your prize is 15");
}

return 0;
}

ayushchauhan
Автор

Bro please teach algorithm and it's flowchart. Its a request....
You teach very well.. Thank you for guidance

vijaybindra
Автор

literally these free educational videos are bringing back the main essence of education: "Available to all and no price to pay"

shivrajanand
Автор

I have not even started watching him yet 😭 but his channel shouts " i wanna be the best thing that's ever happened to you"
Thank you❤

AjoAjo-ytuo
Автор

#include <stdio.h>
int main (){
int a;
printf("In how many sub you got passing marks\n");
printf("enter 1 if pass in maths\n");
printf("enter 2 if pass in science\n");
printf("enter 3 if pass in both\n");
scanf("%d", &a);
if(a==1||a==2){
printf("congratulations you got ₹15");
}
else if(a==3){
printf("congratulations you got ₹45");
}
return 0;
}
I think 🤔 I m late 😅 but still I got what you explain

rajputfitness
Автор

#include <stdio.h>
int main(int argc, char const *argv[])
{
int exam;
printf ("Which Subject you have clear\n", exam);
printf ("You have clear maths then press 1\n", exam);
printf ("You have clear science then press 2\n", exam);
printf ("You have clear both subjects then press 3\n", exam);
scanf ("%d", &exam);

if (exam==1)
{
printf("you won 15 rupee");
}

else if (exam==2)
{
printf("you won 15 rupee");
}

else if (exam==3)
{
printf("you won 45 rupee");
}



return 0;
}

blessedthoughts
Автор

Thanks Harry.
This is my first programming language and you make this very easy.

MiniMarvelsStudio-os
Автор

#include <stdio.h>


int main(){
int a;
printf("Which of the subjects have you passed? \n");
printf("Type 1 for maths, 2 for Science, 3 for both maths and science \n");
scanf("%d", &a);


if(a == 1){
printf("Wow!, you have won the prize of Rs15 for clearing the exam of Maths\n");
}
else if(a == 2){
printf("Wow!, you have won the prize of Rs15 for clearing the exam of Science\n");
}
else if(a == 3){
printf("Wow!, you have won the prize of Rs45 for clearing the exam of Maths and Science\n");
}
else
{
printf("Sorry! this choice is not given please select from the above given options.\n");
}

return 0;
}

shubhamjaiswal
Автор

#include <stdio.h>
// maths and science -45
// science -15
// maths -15
int main ()
{
int sub ;
printf("Enter which all subject you passed : \n");
printf("1 for maths and science \n 2 for maths \n 3 for science : \n");
scanf("%d", &sub);
if(sub==1)
{
printf("45 rupee gift ");
}
else if (sub==2)
{
printf("15 rupee gift ");
}
else if(sub==3)
{
printf("15 rupee gift ");
}
else
{
printf("Wrong choice :");
}
}

Fzon-
Автор

Bhai challage ka code bhi share kr diya kro jitne bhi diye h check krne k liye .

Wese bhai maja aa rha h
Printf("maza aa rha h");

kapilchaudhary
Автор

Sir I am a student of BCA 1st sem and today i watch your video and i am very happy that i found my channel love you sir and i like your explanation

CREATEWITHSAHID
Автор

... i was confused how should i start . those tutorial on websites are very complicated and terrible .
but your body language and expressing techniques are damn amezing .

skytoucher
Автор

To all those who do are not able to code the question here is the answer

#include <stdio.h>
int main()
{
int subject;
printf("The list of subjects which you have passed has been given below\n");
printf("1. Science only\n 2. Maths only\n 3. Both Science and Maths\n");
printf("Choose one of the options above: ");
scanf("%d", &subject);
if (subject == 1)
{
printf("Hurrayy! You have won 15 rupees");
}
else if (subject == 2)
{
printf("Hurrayy! You have won 15 rupees");
}
else if (subject == 3)
{
printf("Hurrayy! You have won 45 rupees");
}
else
{
printf("You have made an invalid choice!");
}




return 0;
}


Challenge accepted and solved also Harry bhaii

TejendraSingh-wq