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
Why do we need volatile in c?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is the purpose of void in c?
If fflush wont work, what can I use to flush input?
Write a program to know whether the input number is an armstrong number.
Explain what is wrong with this program statement? Void = 10;
What are the types of data structures in c?
What is difference between structure and union with example?
What is p in text message?
Explain how can a program be made to print the name of a source file where an error occurs?
What is fflush() function?
What is a substring in c?
Is there a built-in function in C that can be used for sorting data?
What are the types of bitwise operator?
What is methods in c?