C program using if else questions and answers

If and else statements :-

If and else:

The if-else statement is a decision making statements that is used to decide wheather the part of the code will be executed of not based on the specified condition

syntax








Example Questions and Answer code :

Example 1

//Write a c program to check the number is even or odd using if and else

#include<stdio.h>
int main()
{
int num;
printf("Enter a number=");
scanf("%d", &num);
if(num%2==0)
{
printf("the entered number is even");
}
else
{
printf("the entered numbers is odd number");
}
}

Example 2


https://kodewithgy.blogspot.com/2024/09/blog-post.html

Example 3


Example 4



Example 5




For if statement:




Thanks   you   for   reading .   For   more   knowledge   click   here

 Learning C programming language from basics concept include with PROGRAMS:

 https://kodewithgy.blogspot.com/2024/09/learning-c-programming-language-from.html


Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post