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

What does %c mean in c?

651


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

780


How do you use a 'Local Block'?

723


Can we access array using pointer in c language?

644


How does normalization of huge pointer works?

640






What does the format %10.2 mean when included in a printf statement?

1088


Why pointers are used?

633


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1461


Explain a file operation in C with an example.

663


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

2455


What is merge sort in c?

644


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

759


Tell me can the size of an array be declared at runtime?

599


What is the difference between char array and char pointer?

525


How can I remove the trailing spaces from a string?

616