program to find a smallest number in an array
Answers were Sorted based on User's Feedback
Answer / suse
main()
{
int a[20],n,i,s;
scanf("%d,%d",&n,&a[i]);
s=a[0];
for(i=0;i<n;i++)
{
if(s>a[i])
{
s=a[i];
}
}
printf("the smallest number is %d",s);
}
| Is This Answer Correct ? | 5 Yes | 7 No |
Answer / kalee
// Algorithm
Add the numbers directly into a set<double> varible, while getting the values from keyboard. First element of this set will be the least integer
This is a bad answer , if memory constraint is to be taken into account
| Is This Answer Correct ? | 4 Yes | 9 No |
Answer / belsia
void main()
{
int a[10];
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
{
if(a[i]>a[i+1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
printf("The smallest element is %d",a[0]);
getch();
}
| Is This Answer Correct ? | 7 Yes | 17 No |
Answer / atul kumar
#include<iostream.h>
void main()
{
int a, b[4]=[1,2,3,4];
a[0]=b[0];
for(i=1;i<=5;i++)
{
if(a>b[i])
{
a=b[i];
}
}
cout<<"smallest num"<<a;
}
| Is This Answer Correct ? | 7 Yes | 18 No |
Determine the result of performing two successive block transfers into the same area of a frame buffer using the binary arith operations
What does c mean?
How do I use void main?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
What is bin sh c?
how to exchnage bits in a byte b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3 please mail me the code if any one know to rajeshmb4u@gmail.com
program to print upper & lower triangle of a matrix
Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....
write a c program to accept a given integer value and print its value in words
4 Answers Vernalis, Vernalis Systems,
How to declare a variable?
2)#include<iostream.h> main() { printf("Hello World"); } the program prints Hello World without changing main() the o/p should be intialisation Hello World Desruct the changes should be a)iostream operator<<(iostream os, char*s) os<<'intialisation'<<(Hello World)<<Destruct b) c) d)none of the above
wap in c to accept a number display the total count of digit