'C' program to find maximum of two numbers.


C File =>


/* Write a ‘C’ program to find maximum of  two numbers. */

#include<stdio.h>
int main() 
{
      int a,b;
      printf("\n Enter number1 : ");
      scanf("%d",&a);
      printf("\n Enter number2 : ");
      scanf("%d",&b);

      if(a>b)
            printf("\n Maximum of number is : %d",a);
     else
            printf("\n Maximum of number is : %d",b);
  return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.