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...

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


Please Help Members By Posting Answers For Below Questions

What is a pragma?

1131


What is c language & why it is used?

1116


What happens if header file is included twice?

1152


Write a program to print numbers from 1 to 100 without using loop in c?

1085


What are the c keywords?

1206


Why header files are used?

1118


Compare interpreters and compilers.

1066


What are the advantages and disadvantages of c language?

1017


What are control structures? What are the different types?

1094


Why is python slower than c?

1090


Explain how can I prevent another program from modifying part of a file that I am modifying?

1094


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

1102


Is c is a middle level language?

1068


Where are local variables stored in c?

1048


Is linux written in c?

1040