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
Explain how can a program be made to print the name of a source file where an error occurs?
In which header file is the null macro defined?
How was c created?
What is the significance of an algorithm to C programming?
Explain what is the advantage of a random access file?
How do we open a binary file in Read/Write mode in C?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
What is static and volatile in c?
What are the different file extensions involved when programming in C?
What are the various types of control structures in programming?
What is indirection in c?
Why isnt there a numbered, multi-level break statement to break out
What is malloc return c?
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 is realloc in c?