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


Please Help Members By Posting Answers For Below Questions

Explain what math functions are available for integers? For floating point?

618


What are file streams?

574


When should a type cast be used?

581


Which header file is essential for using strcmp function?

947


How are portions of a program disabled in demo versions?

758






What does dm mean sexually?

822


What is the heap?

693


What are conditional operators in C?

630


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

786


How can you find out how much memory is available?

620


What is %d called in c?

765


write a program to copy the string using switch case?

2406


Is javascript based on c?

599


List the variables are used for writing doubly linked list program.

1628


How is a null pointer different from a dangling pointer?

563