Hello friends C4fun brings you new question every day now it's time to find the largest number among the given numbers follow the problem statement and build the code decoding yourself I do remember.....



program to print largest of 3 numbers



C for fun brings you to program to find the largest number among the given numbers this might be any number of like three four five you have to find the greatest number among the given numbers.

A user will input a maximum of any number which she wants like 345 any number can be there You have to find the maximum or the largest number among the given pair of numbers for this the program or the source code has been provided below use the description for the problem statement as the generator of your code of the C language go step by step slowly through the algo you will find that it's a very simple program to make.

The problem description has been described below which is treated as
Problem Description
the program takes the 3 numbers and finds the largest among all.

Now it's time for the solution how to go or what are the steps you have to follow to make the program just follow the blues tab stated and you will find the answer very easily
 Solution?
1.  reqired  three numbers as input.
2. Check  first  if it greater than other two.
3. Repeat the step 2 for other
4. Print the number which is greater .


Hope you have gone through the I'll go now it's time to do the quote the source code has been provided below but first go for yourself and if you are struck Then look at the source code



#include<stdio.h>
#conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the 3 numbers\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b&&a>c)
{
printf("\n%d is largest",a);
}
if(b>a&&b>c)
{
printf("\n%d is largest",b);
}
if(c>a&&c>b)
{
printf("\n%d is largest",c);
}
getch();
}



Hope you have done with the code and have generated the results are the expected output as you have desired with the program now make some changes in the program and updated see the different result you have obtained after changing the coding.
Comment below the result you have obtained after changing the different patterns and the numbers share with your friends and comment below the experience you have when you and put the wrong numbers.


Explanation of the program running how its help the code to run or how it has been executed explained below human go through the explanation and you will find the step by step solution of the code
Explanation...
. input three numbers & store them in variables.
. check if the num1 is greater than num2.if yes.
  then check if , larger than 3rd  number also.
. If it is, print “num1 is the largest ”.
. If  num1 is not greater than 2nd number, then check if 2nd number is greater than 3rd number
. If yes then 
print the output as  2nd number is the greatest ”.
. Otherwise, print the output as “ 3rd number is largest”.


Now it's time for sharing and caring C for fun is based on the sharing is caring concept shared it among your friends and whom you think it would help to get the code share among your friends and help them to build a code and a basic knowledge of the program
Keep learning
Keep coding
And visit C for fun on daily basis for the updated programs

No comments

thanks for reading and sharing.I hope it would help you!!!!

Powered by Blogger.