program to find a smallest number in an array

Answer Posted / asif ali afsar

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],b,c,n;
clrscr();
printf("How many size you want to Cheah\n");
scanf("%d",&n);
printf("Enter the numbers\n");
for(b=0; b<n; b++)
{
scanf("%d",&a[b]);
}
for(b=0; b<n; b++)
{
if(c<a[b])
{
c=c;
}
else
{
c=a[b];
}
}
printf("smalest no is %d",c);
getch();
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I send mail from within a c program?

577


What are different types of variables in c?

566


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1481


Which type of language is c?

642


What is the right type to use for boolean values in c?

580






Difference between Function to pointer and pointer to function

625


What are preprocessor directives in c?

630


provide an example of the Group by clause, when would you use this clause

1703


What is the difference between malloc() and calloc() function in c language?

596


What is the collection of communication lines and routers called?

604


What is typedef struct in c?

577


What is the meaning of typedef struct in c?

584


Describe newline escape sequence with a sample program?

647


How can I write functions that take a variable number of arguments?

620


Why we use break in c?

544