-->

Facebook

Jasper Roberts - Blog

Wednesday, October 1, 2014

if statement

if statement(s):

- in if statement, if the condition is true than it will execute the block of statements.

- if the condition is false then it will not execute the block of statement.




-   Syntax:
               if(condition)
               {
                          statement(s);
                }




-   Flow chart:
if statement
if statement




   - Example: A C program to check the student is pass.

#include<conio.h>
#include<stdio.h>

void main()
{
     float per;
     clrscr();
    
     printf(“enter the percentage:”);              
     scanf(“%f”,&per);

     if(per>35)
     {
          printf(“Student is pass.”);
     }
    
     getch();
}


OUTPUT:
enter the percentage: 65
Student is pass.


DOWNLOAD          DOWNLOAD
           

No comments:

Post a Comment