Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if-else statements in C
#1
Conditional statements allow you to execute different code blocks based on certain conditions.

int num = 10;
if (num > 0) {
    printf("Positive\n");
} else if (num < 0) {
    printf("Negative\n");
} else {
    printf("Zero\n");
}
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Break and Continue statements in C Qomplainerz 0 318 07-25-2023, 11:00 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 2 Guest(s)