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
What are the advantages and disadvantages of c language?
Which is best book for data structures in c?
What is the c language function prototype?
how do you execute a c program in unix.
Why is c called a structured programming language?
What are the advantages and disadvantages of pointers?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What are enums in c?
What is c system32 taskhostw exe?
Why does this code crash?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
can anyone suggest some site name..where i can get some good data structure puzzles???
What happens if you free a pointer twice?
What is a good data structure to use for storing lines of text?
What is && in c programming?