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
Define Array of pointers.
Should I learn data structures in c or python?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
Why enum is used in c?
What is c token?
What is the meaning of c in c language?
Is stack a keyword in c?
What is echo in c programming?
Explain how do you list files in a directory?
When can a far pointer be used?
Explain what is dynamic data structure?
What is the explanation for cyclic nature of data types in c?
What are the types of c language?
What is 2c dna?