wap in c to accept n number display the highest and lowest
value
Answers were Sorted based on User's Feedback
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 |
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 |
what is difference between array of characters and string
program for reversing a selected line word by word when multiple lines are given without using strrev
What does. int *x[](); means ?
main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail
Do you know pointer in c?
What does c mean?
a C prog to swap 2 no.s without using variables just an array?
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
What are volatile variables in c?
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,
Are bit fields portable?
What are pragmas and what are they good for?