Write a program,using functions,to find the biggest integers


#include<stdio.h>
#include<conio.h>
int greater(int *a,int *b,int *c,int *large);
void main()
{
int num1,num2,num3,large;
printf("\n Enter the first number:");
scanf("%d",&num1);
printf("\n Enter the second number:");
scanf("%d",&num2);
printf("\n Enter the third number:");
scanf("%d",&num3);
greater(&num1,&num2,&num3,&large);
getch();
}
int greater(int *a,int *b,int *c,int *large)
{
if(*a>*b && *a>*c)
{
*large=*a;
}
if(*b>*a && *b>*c)
{
*large=*b;
{
else
{
*large=*c;
printf("\n Largest number=%d",*large);
}


Output


Enter the first number:1
Enter the second number:7
Enter the third number:9
Largest number=9


Write a program to print even no


#include<stdio.h>
#include<conio.h>
void main()
{
int m,*pm=&m;
printf("\n Enter the number");
scanf("%d %d",pm,pn);
if(*pm %2==0)
{
printf("\n %d is even",*pm);
}
else
{
printf("\n %d is odd", *pm);
}
}


Output

Enter the number:
2
2 is even


Comments