The general form of a simple if statement is,
if(expression)
{
statement-inside;
}
statement-outside;
If the expression is true, then 'statement-inside' it will be executed, otherwise 'statement-inside' is skipped and only 'statement-outside' is executed.
//Write a C Program which demonstrate use of if statement.
#include<stdio.h>
#include<conio.h>
void main()
{
int x,y;
x = 7;
y = 5
if(x > y)
{
printf("x is greater than y");
}
getch();
}
Ask Question