Write a C program using a function with argument and without return type.

 

C program

C PROGRAM

Write a  C program using a function with argument and without return type


#include <stdio.h>
#include<conio.h>
void greatnum(int,int);
void main()
{
  int a,b,result;
  clrscr();
  printf("enter the two numbers \n");
  scanf("%d%d",&a,&b);
  greatnum(a,b);
  getch();
  }
  void greatnum(int x,int y)
  {
  int i;
  if(x>y)
  printf("the greatest number is %d",x);
  else
  printf("the greatest number is %d",y);
  }

OUTPUT:

enter the two numbers 

2

8

the greatest number is 8

Process finished.


   infinitynotes00

No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.