program to find a smallest number in an array
Answer Posted / belsia
void main()
{
int a[10];
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
printf("The smallest element is %d",a[0]);
getch();
}
Is This Answer Correct ? | 7 Yes | 17 No |
Post New Answer View All Answers
What are void pointers in c?
Why does the call char scanf work?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What is .obj file in c?
What are the two types of functions in c?
Can you write a programmer for FACTORIAL using recursion?
Are the expressions * ptr ++ and ++ * ptr same?
What is the explanation for prototype function in c?
What is the purpose of the preprocessor directive error?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
What is oops c?
Explain a file operation in C with an example.
Give differences between - new and malloc() , delete and free() ?
What is array of pointers to string?