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

What is the sizeof () a pointer?

555


What is a node in c?

554


Why is a semicolon (;) put at the end of every program statement?

632


What would be an example of a structure analogous to structure c?

578


Explain how can I remove the trailing spaces from a string?

632






When is the “void” keyword used in a function?

847


Is Exception handling possible in c language?

1588


How variables are declared in c?

576


What is multidimensional arrays

637


Explain can the sizeof operator be used to tell the size of an array passed to a function?

599


How do you print an address?

752


Describe static function with its usage?

616


What is the use of pointers in C?

627


How do you use a 'Local Block'?

728


How many keywords are there in c?

599