Start working on C Program
Easy codes to find the biggest number
Lets try out the example
/*C program to find greatest of three numbers using function*/
#include
/*function to get largest among three numbers*/
int largestNumber(int a,int b, int c)
{
int largest=0;
if(a>b && a>c)
largest=a;
else if(b>a && b>c)
largest=b;
else
largest=c;
return largest;
}
int main()
{
int a,b,c;
printf("Enter three numbers: ");
scanf("%d%d%d",&a,&b,&c);
printf("Largest number is: %d\n",largestNumber(a,b,c));
return 0;
}
Enter three numbers: 100 158 94
Largest number is: 158