Program to print the 10 number and find the biggest number in 10 numbers in c-programming
In this program we will now input 10 number by the user using array and find the biggest number in 10 number in c-program
//program to find the biggest elements
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,max;
printf("enter the number:-");
for(i=0;i<=9;i++){
scanf("%d",&a[i]);
}
max=a[0];
for(i=0;i<=9;i++){
printf("%d ",a[i]);
if(max<a[i])
max=a[i];
}
printf("\n the biggest number in the array is %d",max);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,max;
printf("enter the number:-");
for(i=0;i<=9;i++){
scanf("%d",&a[i]);
}
max=a[0];
for(i=0;i<=9;i++){
printf("%d ",a[i]);
if(max<a[i])
max=a[i];
}
printf("\n the biggest number in the array is %d",max);
getch();
}
output:-
For more c-programming:-

No comments:
Post a Comment