If statement in c

 

  1. if statement The if 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;

}



No comments

Theme images by Jason Morrow. Powered by Blogger.