program to find a smallest number in an array
Answer Posted / sathish
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);
}
Is This Answer Correct ? | 138 Yes | 57 No |
Post New Answer View All Answers
Explain function?
How do you define a function?
What does do in c?
What is a structure in c language. how to initialise a structure in c?
Should I learn data structures in c or python?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Explain about the functions strcat() and strcmp()?
What does struct node * mean?
How can you check to see whether a symbol is defined?
What is the need of structure in c?
What is external variable in c?
write a proram to reverse the string using switch case?
What does *p++ do? What does it point to?
c language interview questions & answer
What does p mean in physics?