write a program to fined second smallest and largest element
in a given series of elements (without sorting)
Answer Posted / mohit kumar
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],max,min,i,temp;
printf("\n enter array element");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
//second smallest number
min=a[0];
for(i=0;i<10;i++)
{
if(min>a[i])
{
min=a[i];
}
| Is This Answer Correct ? | 20 Yes | 39 No |
Post New Answer View All Answers
What is a dynamic array in c?
Is r written in c?
Can we compile a program without main() function?
Is there any demerits of using pointer?
What is scanf () in c?
What is sizeof int in c?
What does the c preprocessor do?
What is the difference between array and pointer?
Can we declare variable anywhere in c?
Can you add pointers together? Why would you?
Define and explain about ! Operator?
What is difference between structure and union in c programming?
How can I get random integers in a certain range?
What are the types of c language?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....