If and else :
Example 2
//Write a c program to check the number is positive or negative using if and else statements
C program code....
#include<stduo.h>
int main()
{
int num;
printf("Enter the number ",num);
Scanf("%d",&num);
if(num>=0);
{
printf("the number is positive");
}
else
{
printf("the number is negative");
}
}
For first example 1
https://kodewithgy.blogspot.com/2024/09/c-program-if-and-else-questions-and.html