Nested if statements are easy! ๐ŸŽŸ๏ธ @BroCodez
Nested if statements are easy! ๐ŸŽŸ๏ธ  @BroCodez
Uploaded March 2025 | Updated September 2026, 1 week ago
#coding #programming #cprogramming

float price = 10.00;
bool isStudent = true; // 10% discount
bool isSenior = true; // 20% discount

// student = $9
// senior = $8
// student + senior = $7

if(isStudent){
if(isSenior){
printf("You get a student discount of 10%\n");
printf("You get a senior discount of 20%\n");
price *= 0.7;
}
else{
printf("You get a student discount of 10%\n");
price *= 0.9;
}
}
else{
if(isSenior){
printf("You get a senior discount of 20%\n");
price *= 0.8;
}
}

printf("The price of a ticket is: $%.2f\n", price);

return 0;
Nested if statements are easy! ๐ŸŽŸ๏ธRealloc in C explained easy! ๐ŸšขLearn how to enter user input in C! โŒจ๏ธCode a C digital clock in 10 minutes! โŒšCode a dice roller program with Java! ๐ŸŽฒLearn hexadecimal in 0x79 seconds #coding #computerscience #programmingLearn enums in 8 minutes! ๐Ÿ“…Learn Java nested loops in 8 minutes! โžฟMatplotlib labels in 6 minutes! ๐Ÿท๏ธLearn the Java ternary operator in 5 minutes! โ”Learn Java multithreading in 8 minutes! ๐ŸงถLearn binary in 01000000 seconds #coding #computerscience #programming
Bro Code |

Nested if statements are easy! ๐ŸŽŸ๏ธ

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER