write a programme to enter some number and find which
number is maximum and which number is minimum from enterd
numbers.
Answer Posted / nitin garg
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
int num[5],i,small=0,large=0;
printf("enter 5 no
");
for(i=0;i<5;i++)
{ scanf("%d",&num[i]);
}
small=num[0];
for(i=0;i<5;i++)
{
if(num[i]>large)
large=num[i];
if(num[i]<small)
small=num[i];
}
printf("
Larger no is: %d",large);
printf("
Smaller no is: %d",small);
getch();
return 0;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Compare and contrast compilers from interpreters.
Is there a way to compare two structure variables?
Is the exit() function same as the return statement? Explain.
What is pointer and structure in c?
Explain how can a program be made to print the line number where an error occurs?
Why is sizeof () an operator and not a function?
Is main is user defined function?
What is the difference between #include and #include 'file' ?
Are the variables argc and argv are always local to main?
What are the different types of objects used in c?
what will be maximum number of comparisons when number of elements are given?
What is the size of array float a(10)?
Is c object oriented?
what is the function of pragma directive in c?
What is character constants?