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 printf () in c?
What are 3 types of structures?
explain what is an endless loop?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is the use of void pointer and null pointer in c language?
What is restrict keyword in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What do you know about the use of bit field?
What is c basic?
Function calling procedures? and their differences? Why should one go for Call by Reference?
Ow can I insert or delete a line (or record) in the middle of a file?
what is event driven software and what is procedural driven software?
What is unary operator?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What is difference between class and structure?