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 sizeof array in c?
What is output redirection?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
When a c file is executed there are many files that are automatically opened what are they files?
Is a house a mass structure?
while initialization of array why we use a[][2] why not a[2][]...?
By using C language input a date into it and if it is right?
Without Computer networks, Computers will be half the use. Comment.
Write the Program to reverse a string using pointers.
Why void main is used in c?
Are pointers really faster than arrays?
What is typedef?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
How important is structure in life?