adspace


Write a code snippets to find greatest and least of any
number of inputs without taking the help of array

Answer Posted / sundar

#include <stdio.h>
#include <conio.h>

void main(void)
{
unsigned int max = 0; unsigned int min = -1;unsigned int
wish = 1;

while(wish)
{
printf("\nEnter The Number sequence ( 0 to terminate ) . .
. ");
scanf("%d",&wish);
if(wish > max) max = wish;
if(wish < min) min = wish;
}
printf(" Max = %u Min = %u ",max,min );
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category