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
How is a structure member accessed?
What are the two types of functions in c?
Write a program to generate random numbers in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is an arrays?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is formal argument?
Difference between malloc() and calloc() function?
Where we use clrscr in c?
What is malloc return c?
How can I convert a number to a string?
What is a newline escape sequence?
What is extern storage class in c?
What are runtime error?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above