program to find a smallest number in an array

Answer Posted / farhana parvin sunny

#include<stdio.h>
#include<conio.h>

int main(void)
{
int n,i,l,a[10];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
l=a[0];
for(i=0;i<n;i++)
{
if(l>a[i])
{
l=a[i];
}
}
printf("the lowest number is %d",l);
getch();
return 0;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Compare and contrast compilers from interpreters.

684


What will be your course of action for a push operation?

669


What are different types of operators?

600


What is "Duff's Device"?

703


Why is c not oop?

541






What is variable and explain rules to declare variable in c?

558


What is the use of f in c?

561


Explain how can I make sure that my program is the only one accessing a file?

633


How do I send escape sequences to control a terminal or other device?

615


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

827


What is storage class?

658


Write a program to generate random numbers in c?

666


How are structure passing and returning implemented?

594


I have seen function declarations that look like this

606


Why c is a procedural language?

587