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


Please Help Members By Posting Answers For Below Questions

Compare and contrast compilers from interpreters.

675


Is there a way to compare two structure variables?

610


Is the exit() function same as the return statement? Explain.

654


What is pointer and structure in c?

558


Explain how can a program be made to print the line number where an error occurs?

682






Why is sizeof () an operator and not a function?

568


Is main is user defined function?

585


What is the difference between #include and #include 'file' ?

601


Are the variables argc and argv are always local to main?

565


What are the different types of objects used in c?

566


what will be maximum number of comparisons when number of elements are given?

1404


What is the size of array float a(10)?

647


Is c object oriented?

534


what is the function of pragma directive in c?

613


What is character constants?

706