Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


wap in c to accept n number display the highest and lowest
value

Answers were Sorted based on User's Feedback



wap in c to accept n number display the highest and lowest value..

Answer / abhilash.d

void main()
{
int n,a[],j,l;
printf("enter the no.of numbers to accept");
scanf("%d",&n);
printf("enter the numbers");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
for(j=1;j<=i;j++)
{
if(a[i]<a[j])
{
l=a[i];
a[j]=a[i];
a[i]=l;
}
}
}
printf("highest value is:"a[0]);
printf("lowest value is:"a[0+n-1]);
}

Is This Answer Correct ?    10 Yes 3 No

wap in c to accept n number display the highest and lowest value..

Answer / raghu

void main()
{
int n,a[],j,l,max,min;
printf("enter the no.of numbers to accept");
scanf("%d",&n);
printf("enter the numbers");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]<=min)
{
min=a[i];
}
else if(a[i]>=max)
{
max=a[i];
}
}
printf("highest value is:",max);
printf("lowest value is:",min);
}

Is This Answer Correct ?    7 Yes 5 No

Post New Answer

More C Interview Questions

what is difference between array of characters and string

18 Answers   Accenture, Nest,


program for reversing a selected line word by word when multiple lines are given without using strrev

0 Answers   IBM,


What does. int *x[](); means ?

0 Answers   Wilco,


main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail

6 Answers   TCS,


Do you know pointer in c?

0 Answers  


What does c mean?

0 Answers  


a C prog to swap 2 no.s without using variables just an array?

5 Answers   TCS,


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

0 Answers  


What are volatile variables in c?

0 Answers  


write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


Are bit fields portable?

0 Answers   EXL,


What are pragmas and what are they good for?

0 Answers  


Categories