program to find a smallest number in an array
Answer Posted / rose
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a[50],temp;
printf("enter the max limit :");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
i=0;
for(j=0;j<n-1;j++)
{
if(a[j+1]<a[j])
{
temp=a[j+1];
a[j+1]=a[j];
a[j]=temp;
}
}
printf("the smnallest is : %d",*(a+0));
getch();
}
| Is This Answer Correct ? | 19 Yes | 15 No |
Post New Answer View All Answers
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What are the 5 types of organizational structures?
What is the use of structure padding in c?
write a proram to reverse the string using switch case?
Can the size of an array be declared at runtime?
Explain what is a 'locale'?
What are the back slash character constants or escape sequence charactersavailable in c?
What is storage class?
What is a macro in c preprocessor?
What is derived datatype in c?
What are the different types of endless loops?
Can we change the value of constant variable in c?
Write a program to swap two numbers without using third variable?
Explain bit masking in c?
How can you check to see whether a symbol is defined?