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 6 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 4 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
- Which HTML Tag Is Used To Define An Internal (embedded) Style Sheet?
- What Are The Accessing Mathods?
- How Does A Model Look The Way She Does?
- Define Demerits Of Conventional File System?
- What Should I Write Down In A Cv In The Topic Interest?
- How Candidate Key Is Differ From Concatenated Key?
- Create A Class Time And Its Data Member Are Hour And Sec By Passing Parameters?
- How To Make Factorial Suing C++?
- How Do You Enable Java Script On Boost Mobile Phones?
- How Do You Enable Java Script On I776?
- Which Is A Entry Controlled Loop?
- What Effect Does Calling A Undefined Function In Javascript Have Upon The Call Stack?
- Is Relational Model Logically Independent?
- Are Current Java-oriented Mutation Testing Tools Adequate? And If Not, What Do They Require To Become Adequate? You Should Address This Question From Both A Test Case Evaluation And An Improving TDD Viewpoint.
- Can Mutation Testing Be Successfully Used To Improve Test Driven Development From A Defect Reduction Perspective?
- Discuss The Relative Advantage Of Centralized And Distributed Databases?
- How Would You Use Derived In A Sentence?
- Can I Browse Web Page By Just Hovering Mouse Over Text Link? How To Browse Website Without Clicking On It?Is There Any Add-on Or Extension In Any Browsers Which Can Browse Web Link By Just Hovering Mouse Cursor For 1- 2 Second Or Moving On It 2 Times
- What Are The Four Types Of System Programs?
- What Does Cdr/cdt Transaction Mean?
- Which Act Had The Highest Number Of Christmas Number Ones?
- Why Do We Have Data Structures?why Not Just Use Arrays In All Programs?
- How Do Accountants Use Databases?
- What The 2 View U Can Use In A Query?
- Write A Program That Takes Two Numbers As Input From The User And Then Display All The Prime?
- 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.