program to find a smallest number in an array

Answer Posted / atul kumar

#include<iostream.h>
void main()
{
int a, b[4]=[1,2,3,4];
a[0]=b[0];
for(i=1;i<=5;i++)
{
if(a>b[i])
{
a=b[i];
}
}
cout<<"smallest num"<<a;
}

Is This Answer Correct ?    7 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can we change the default calling convention in c if yes than how.........?

2052


how could explain about job profile

1466


How is a null pointer different from a dangling pointer?

571


Write a function that will take in a phone number and output all possible alphabetical combinations

617


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3069






What is a char c?

609


What is include directive in c?

662


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

776


What is the difference between exit() and _exit() function in c?

600


How can I convert a number to a string?

623


Why is sizeof () an operator and not a function?

605


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

787


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

5000


What is string in c language?

641


What is the size of enum in c?

635