program to find a smallest number in an array
Answer Posted / 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 |
Post New Answer View All Answers
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What do you understand by normalization of pointers?
Suggesting that there can be 62 seconds in a minute?
What are the 4 types of programming language?
Should I learn data structures in c or python?
What are 3 types of structures?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
In C programming, what command or code can be used to determine if a number of odd or even?
What are qualifiers in c?
How do c compilers work?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is the difference between array and pointer?
What does %2f mean in c?
What is bin sh c?
How can I copy just a portion of a string?