program to find a smallest number in an array
Answer Posted / anu
#include<iostream.h>
#include<conio.h>
void main()
{
int a[20],n,i,s;
clrscr();
cout<<"Enter valur of n";
cin>>n;
cout<<"Enter the elements";
for(i=0;i<n;i++)
{
cin>>a[i];
}
s=a[0];
for(i=0;i<n;i++)
{
if(s>a[i])
{
s=a[i];
}
}
cout<<"The smallest number is"<<s
getch();
}
| Is This Answer Correct ? | 10 Yes | 7 No |
Post New Answer View All Answers
What is an array in c?
Why c is called a mid level programming language?
What Is The Difference Between Null And Void Pointer?
Why is this loop always executing once?
Difference between malloc() and calloc() function?
What is operator precedence?
What is the use of volatile?
In C, What is the #line used for?
What are the functions to open and close the file in c language?
How can a number be converted to a string?
How are structure passing and returning implemented?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
How can you find out how much memory is available?
Explain which function in c can be used to append a string to another string?
What are the application of c?