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
Tell me when would you use a pointer to a function?
What is double pointer in c?
What is the equivalent code of the following statement in WHILE LOOP format?
please send me the code for multiplying sparse matrix using c
What is an arrays?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is the function of volatile in c language?
What is the difference between printf and scanf )?
Write a program to print fibonacci series without using recursion?
Is javascript written in c?
How can I swap two values without using a temporary?
What are the ways to a null pointer can use in c programming language?
Explain the difference between structs and unions in c?
Implement bit Array in C.