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
List the variables are used for writing doubly linked list program.
What is self-referential structure in c programming?
Explain about block scope in c?
Who is the founder of c language?
Can you please explain the difference between exit() and _exit() function?
Explain what does it mean when a pointer is used in an if statement?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
what are the facialities provided by you after the selection of the student.
How can you avoid including a header more than once?
Explain what is the best way to comment out a section of code that contains comments?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What are the data types present in c?
What are the disadvantages of a shell structure?
What is the difference between procedural and functional programming?
What is the auto keyword good for?