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[j];
a[j]=temp;
}
}
printf("The smallest element is %d",a[0]);
getch();
}
| Is This Answer Correct ? | 26 Yes | 28 No |
Post New Answer View All Answers
What is string length in c?
Why is it important to memset a variable, immediately after allocating memory to it ?
Explain what is the heap?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
Why can’t constant values be used to define an array’s initial size?
What is the difference between a free-standing and a hosted environment?
Write a program to use switch statement.
what are # pragma staments?
What are pointers in C? Give an example where to illustrate their significance.
What is data type long in c?
Explain what are its uses in c programming?
Define Spanning-Tree Protocol (STP)
What is the difference between functions abs() and fabs()?
How can I sort a linked list?
What is spaghetti programming?