Thursday, January 17, 2019

C Program To Print Greater Number Between Two Numbers


Greater number between two numbers:-

In this C program we will print greater one number between two numbers from user input value. Here we take two int type variables for input first number and second number.

   /*
      Program : Greatest Numbers Between Two Numbers
      Filename : greatestNumber.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
   */
  #include<stdio.h>
  int main()
   {
       int number1, number2;
       printf("Enter the first number :");
       scanf("%d",&number1);
       printf("Enter the second number :");
        scanf("%d",&number2); 
          if(number1>number2)
             {
                  printf("First number is greater than second number");            
             }
           else
             {               
                  printf("Second number is greater than first number");
             }  
       return 0;
   } 

Output :

  Program run first time:-
 
  Enter the first number : 18
  Enter the second number :12
  First number is greater than second number
 
  Program run second time:-
 
  Enter the first number : 156
  Enter the second number :174
  Second number is greater than first number





0 comments:

Welcome to you in All Coding Help