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
What is the difference between declaring a variable and defining a variable?
What does volatile do?
Is flag a keyword in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What are formal parameters?
What the advantages of using Unions?
explain how do you use macro?
Explain about the functions strcat() and strcmp()?
What is extern keyword in c?
What is #line?
What are valid operations on pointers?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Explain what is the benefit of using enum to declare a constant?
How many keywords are there in c?