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
string reverse using recursion
Under what circumstances does a name clash occur?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
Explain how do you determine the length of a string value that was stored in a variable?
Is python a c language?
What are the various types of control structures in programming?
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is null pointer in c?
What is a sequential access file?
What are static variables in c?
What is difference between Structure and Unions?
What is the use of extern in c?
Why we use stdio h in c?
Why flag is used in c?
What is the auto keyword good for?