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 |
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} what would be the output?
Explain what is the most efficient way to store flag values?
What is the purpose of & in scanf?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Explain what are the different data types in c?
Explain goto?
WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
Explain threaded binary trees?
how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");
What is the difference between typedef struct and struct?
How to declare a variable?
What are keywords in c with examples?