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
When was c language developed?
Can we use any name in place of argv and argc as command line arguments?
What are the primitive data types in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
how can use subset in c program and give more example
What are reserved words?
How can I convert a number to a string?
How can I read a binary data file properly?
What is the difference between break and continue?
What are the different data types in C?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
What is c language in simple words?
What is structure padding and packing in c?
What is the difference between int main and void main?
Which is the memory area not included in C program? give the reason