4 Answers - Sort by: Date | Rating
#include
#include
void main()
{
clrscr();
int a,b,c;
printf("nt Enter the first number : ");
scanf("%d",&a);
printf("nt Enter the second number : ");
scanf("%d",&b);
printf("nt Enter the third number : ");
scanf("%d",&c);
if(a>b && a>c)
printf("nt The greatest number is : %d ",a);
if(b>a && b>c)
printf("nt The greatest number is : %d ",b);
if(c>a && c>b)
printf("nt The greatest number is : %d ",c);
getch();
}
#include
void main()
{
clrscr();
int a,b,c;
printf("nt Enter the first number : ");
scanf("%d",&a);
printf("nt Enter the second number : ");
scanf("%d",&b);
printf("nt Enter the third number : ");
scanf("%d",&c);
if(a>b && a>c)
printf("nt The greatest number is : %d ",a);
if(b>a && b>c)
printf("nt The greatest number is : %d ",b);
if(c>a && c>b)
printf("nt The greatest number is : %d ",c);
getch();
}
1
0
Guest
answered 5 months ago
Here is the gretest of three numbers. And yes if you need for more numbers just increase SIZE, no more changes needed.
#include<stdio.h>
#include<conio.h>
#define SIZE 3
void main()
{
int Nums[SIZE], i,Greatest=0;
printf("Enter three numbers: ");
for(i=0;i<SIZE;i++)
scanf("%d",&Nums[i]);
for(i=0;i<SIZE;i++){
if (Greatest<Nums[i])
Greatest=Nums[i];
}
printf("Greatest number is:t %d",Greatest);
getch();
}
#include<stdio.h>
#include<conio.h>
#define SIZE 3
void main()
{
int Nums[SIZE], i,Greatest=0;
printf("Enter three numbers: ");
for(i=0;i<SIZE;i++)
scanf("%d",&Nums[i]);
for(i=0;i<SIZE;i++){
if (Greatest<Nums[i])
Greatest=Nums[i];
}
printf("Greatest number is:t %d",Greatest);
getch();
}
0
0
Mesak Lawmkima, Jr.Technician(Software) - Member of Faculty, ZENICS Computer Academy, Aizawl, Mizoram
#include
void main()
{
int x, y, z;
clrscr();
printf("Enter any three numbers : ");
scanf("%d %d %d", &x, &y, &z)
if(x>y>z)
{
printf("The first number is greatest");
}
if(y>z>x)
{
printf("The second number is greatest");
}
if(z>x>y)
{
printf("The third number is greatest");
}
getch();
}
#include
void main()
{
int x, y, z;
clrscr();
printf("Enter any three numbers : ");
scanf("%d %d %d", &x, &y, &z)
if(x>y>z)
{
printf("The first number is greatest");
}
if(y>z>x)
{
printf("The second number is greatest");
}
if(z>x>y)
{
printf("The third number is greatest");
}
getch();
}
0
0
Guest
answered 3 months ago
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a,c,b;
cout<<"enter three numbers";
cin>>a;
cin>>b;
cin>>c;
if(a>b && a>c)
{
cout<<a<<"is the greatest of all"<<endl;
}
else if(b>a && b>c)
{
cout<<b<<"is greatest of all"<<endl;
}
else if(c>a && c>b)
{
cout<<c<<"is greatest of all"<<endl;
}
getch();
}
0
1
- What Is An Example Of An Input Devise?
- What Is A Distributed Amine?
- What Is The Function Of A Corporate Data Model?
- What Is The Point Of A Report In Database?
- How Can We Find A Factorial Of A Number Using Classes And Objects?
- Can We Write Int Tower(int N,int Source,int Temp,int Destination) Instead Of Void Tower(int N,int Source,int Temp,int Destination) In The TOWER OF HANOI Program?
- Can We Use Void Tower(int N,int Source,int Temp,int Destination) Instead Of Int Tower(int N,int Source,int Temp,int Destination) In The Tower Of Hanoi Program?
- What Is The Different B/n Css & Html?
- What Programming Language Do Most Websites Use?
- Discuss The Challenges Of Data Base Management Today?
- When Does Overloading Occurs?
- Describe The Problems With Two-tier Client-server Dbms Architecture?
- What Is Object-Orientation Approach In Information Systems?
- What Are The Functions In Visual Basic?
- What Is Pass By Value In Visual Basic?
- EXPLAIN THE Pass By Value & Pass By Reference In Visual Basic?
- What Is A Declarative Programming Language?
- In Windows Based Programming,what Do You Mean By Controls,properties Of Control,events And Methods?
- How To Enable LAN When Not Active Or Functioning?
- Without Using Arithmetic Operator How To Add Two Values In Php?
- How To Make Your Phone Java Supported?
- Write Down The Complete Html Code To Generate A Web Page In The Following Format As Shown Below?
- What Is The Difference Between Two Tier And Three Tier Client/server Architecture?
- Describe The Problem With Two- Tier Server Dbms Architecture?
- What Is The Difference Between Two-tier And Three Tier Client Server Architecture?
- How Do You Write A Program In C++ To Find The First 'N' Prime Numbers?
- How Can Write A Program To Find Prime Numbers?
- How To Write A Program That Finds All Prime Palindromes Between Two Numbers A And B?
- Write A C++ Program That Will Display The Sum Of Prime Numbers From 1 To N?
- Write A Program To Find A Prime Number?
- How To Write A Program In Java To Find The Prime Number Between 1 To 100?
- Write A Program That Input 2 Numbers And Find Out Either It Is +ve.-ve Or Zero?

New Comment - Comments are editable for 5 min.