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
write a program to generate address labels using structures?
p*=(++q)++*--p when p=q=1 while(q<=6)
What are types of functions?
Why string is used in c?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
If errno contains a nonzero number, is there an error?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What are preprocessor directives in c?
What is a char c?
How are Structure passing and returning implemented by the complier?
How variables are declared in c?
What do you mean by a sequential access file?
Write a code of a general series where the next element is the sum of last k terms.
what is the difference between 123 and 0123 in c?
What is malloc and calloc?