write a program in c language that uses function to locate
and return the smallest and largest integers in an
array,number and their position in the array. it should
also find and return the range of the numbers , that is ,
the difference between the largest number and the smallest.
Answer / vadivelt
Hi Guys,
Pls Post some unusual and difficult questions. These qns
are very common. Anyway am posting the answer.
Code is here.,
#include<stdio.h>
#include<conio.h>
void main()
{
int a[100];
int count, i, j, temp;
printf("ENTER THE NO OF ELEMENTS IN THE ARRAY\n");
scanf("%d", &count);
printf("ENTER THE ARRAY ELEMENTS\n");
for(i = 0; i<count;i++)
{
scanf("%d", &a[i]);
}
for(i = 0; i<count; i++)
{
for(j = i+1; j<count; j++)
{
if(a[i] > a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
printf("\nLargest no is: %d \n", a[count-1]);
printf("Smallest no is: %d \n", a[0]);
printf("Differance is: %d \n", a[count-1] - a[0]);
getch();
}
| Is This Answer Correct ? | 10 Yes | 1 No |
int main() { int i=-1,j=-1;k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d%d%d%d%d",i,j,k,l,m); }
1,1,5,17,61,217,?,?.
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
Sir,please help me out with the output of this programme:- #include<stdio.h> #include<conio.h> void main() { int a=18,b=12,i; for(i=a<b?a:b;a%i||b%i;i--); printf("%d %d",i); }
how to implement stack operation using singly linked list
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986
What is an example of enumeration?
What is the exact difference between '\0' and ""
though sbi was nationalized why its not comes under nationalized banks and its comes under publicsector banks
3 Answers State Bank Of India SBI,
write an algorithm and c program to add two 2x2 matrics
What is the difference between break and continue?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result