program to find a smallest number in an array
Answer Posted / azhar shaik
int n, i,small,a[30];
clrscr();
pf("enter the no.of elements in an array");
sf("%d",&n);
pf("enter the elements \n");
for(i=0;i<n;i++)
{
pf("a[%d]= ,"i);
sf("%d\n",&ai[i]);
}
pf(" displaty the array elements ");
for(i=0;i<n;i++)
{
pf("%d\t",a[i]);
}
pf("smallest element from an array "):
small=a[0];
for(i=1;i<n;i++)
{
if(small>a[i])
{
small=a[i];
}
pf("smallest element is %d ",small);
getch();
}
hint:pf =print f ,sf =scan f
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What are the different types of constants?
Explain how can a program be made to print the name of a source file where an error occurs?
How do you initialize pointer variables?
What are the types of macro formats?
What is the scope of local variable in c?
Explain built-in function?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
what is the height of tree if leaf node is at level 3. please explain
Why do we use namespace feature?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
In a switch statement, what will happen if a break statement is omitted?
Can you write the function prototype, definition and mention the other requirements.
Lists the benefits of c programming language?
What is the difference between new and malloc functions?