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


program to find a smallest number in an array

Answers were Sorted based on User's Feedback



program to find a smallest number in an array..

Answer / suse

main()
{
int a[20],n,i,s;
scanf("%d,%d",&n,&a[i]);
s=a[0];
for(i=0;i<n;i++)
{
if(s>a[i])
{
s=a[i];
}
}
printf("the smallest number is %d",s);
}

Is This Answer Correct ?    5 Yes 7 No

program to find a smallest number in an array..

Answer / fg

vcxcx

Is This Answer Correct ?    0 Yes 2 No

program to find a smallest number in an array..

Answer / kalee

// Algorithm

Add the numbers directly into a set<double> varible, while getting the values from keyboard. First element of this set will be the least integer

This is a bad answer , if memory constraint is to be taken into account

Is This Answer Correct ?    4 Yes 9 No

program to find a smallest number in an array..

Answer / belsia

void main()
{
int a[10];
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
printf("The smallest element is %d",a[0]);
getch();
}

Is This Answer Correct ?    7 Yes 17 No

program to find a smallest number in an array..

Answer / atul kumar

#include<iostream.h>
void main()
{
int a, b[4]=[1,2,3,4];
a[0]=b[0];
for(i=1;i<=5;i++)
{
if(a>b[i])
{
a=b[i];
}
}
cout<<"smallest num"<<a;
}

Is This Answer Correct ?    7 Yes 18 No

Post New Answer

More C Interview Questions

Is an array parameter is always "by reference" ?

1 Answers  


What is the use of sizeof?

0 Answers  


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

0 Answers  


what is compiler

7 Answers  


Why isnt any of this standardized in c?

0 Answers  


which operator having highest precedence? a.)+ b.)++ c.)= d.)%

4 Answers  


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

0 Answers  


#include<stdio.h> #include<conio.h> void main() { clrscr(); int a=0,b=0,c=0; printf("enter value of a,b"); scanf(" %d %d",a,b); c=a+b; printf("sum is %d",c); getch(); }

2 Answers  


Are there namespaces in c?

0 Answers  


What is a static function in c?

0 Answers  


write a program that eliminates the value of mathematical constant e by using the formula e=1+1/1!+1/2!+1/3!+

1 Answers   Reliance,


Write a program to check armstrong number in c?

0 Answers  


Categories