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
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is a good way to implement complex numbers in c?
What is the use of typedef in structure in c?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
What is s or c?
Is it better to use malloc() or calloc()?
What is the difference between null pointer and wild pointer?
What is dynamic dispatch in c++?
What does int main () mean?
What is 1d array in c?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Can you please explain the difference between syntax vs logical error?
List some of the dynamic data structures in C?
Is that possible to add pointers to each other?