program to find a smallest number in an array

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a node in c?

564


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2213


Explain the use of keyword 'register' with respect to variables.

607


Explain the use of bit fieild.

728


What is break in c?

601






What are the features of c languages?

642


how can use subset in c program and give more example

1517


With the help of using classes, write a program to add two numbers.

634


What are linker error?

630


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

689


What does emoji p mean?

620


What is the code for 3 questions and answer check in VisualBasic.Net?

1708


What is static and auto variables in c?

579


What is the difference between ++a and a++?

713


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

619