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
What is difference between function overloading and operator overloading?
Explain how many levels deep can include files be nested?
What is meant by gets in c?
What is the difference between a string and an array?
How to throw some light on the b tree?
What are pointers in C? Give an example where to illustrate their significance.
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What is union and structure in c?
What do you know about the use of bit field?
What is 'bus error'?
What are the similarities between c and c++?
What is the use of ?
What is the purpose of main( ) in c language?
Can we compile a program without main() function?
What is typedef struct in c?