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
What is meant by errors and debugging?
Explain how do you use a pointer to a function?
What is ctrl c called?
praagnovation
why we wont use '&' sing in aceesing the string using scanf
find the sum of two matrices and WAP for it.
Who invented bcpl language?
What is static and auto variables in c?
How do you declare a variable that will hold string values?
List the difference between a "copy constructor" and a "assignment operator"?
Can a void pointer point to a function?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What are the types of type qualifiers in c?
When is a null pointer used?
What is the difference between far and near ?