If statement in c
if
statement Theif
statement is used to execute a block of code if a particular condition is true.
Syntax:
if (condition)
{ // statements to execute when the condition is true }
Example
#include<stdio.h>
#include<conio.h>
int main()
{
int num = 10;
if (num > 0)
{
printf("The number is positive\n");
}
return 0;
}
Post a Comment