Tuesday, April 14, 2020

If statement in C

  • Flowchart :
  • Syntax :
if(condition) 
{
   // Statements to execute if
   // condition is true
}
  • Program :
#include<stdio.h>
#include<conio.h>
void main()
{
  int a;
  clrscr();
  printf("\n----------------IF STATEMENT----------------");
  printf("\nEnter your age :");
  scanf("%d",&a);
  if(a>=18)
  printf("\nYou are major.");
  getch();
}

  • Output :



No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...