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

Answer Posted / .::get lost::.

#include<stdio.h>
#include<conio.h>

void main()
{
int a[20],n,i,s;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&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);
getch();
}

Is This Answer Correct ?    24 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Create a simple code fragment that will swap the values of two variables num1 and num2.

1236


I have seen function declarations that look like this

993


How can you access memory located at a certain address?

1062


Is c programming hard?

970


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

989


What does c value mean?

1114


Explain logical errors? Compare with syntax errors.

1010


Is there any possibility to create customized header file with c programming language?

1003


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

975


Hi can anyone tell what is a start up code?

2000


What is the difference between malloc() and calloc()?

1689


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1677


Explain About fork()?

1057


Explain why c is faster than c++?

1004


explain what is an endless loop?

1032