Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » BeginnersRSS Feeds

Program to find greatest number from two numbers using if statement

Posted By: Wagner Fischer     Category: C Programming     Views: 34188

Write a program to find greatest number from two numbers using if statement.

Code for Program to find greatest number from two numbers using if statement in C Programming

#include <stdio.h>
main()
{
int i,j,big;  //variable declaration
scanf("%d%d",&i,&j); big = i;
if(big < j)   // statement A

{      // C
big = j;     
}     // D
printf("biggest of two numbers is %d \n",big);
if(i < j)  // statement B

    {
    big = j;   
    }
  else
    {
    big = i; 
    }
printf("biggest of two numbers(using else) is %d \n",big);
}
  
Share: 



Wagner Fischer
Wagner Fischer author of Program to find greatest number from two numbers using if statement is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!