Write a program to find largest number out of ten numbers.|Shubham tiwari


Aim:-Write a program to find largest number out of ten numbers.(Using for-loop)

Source Code:-

#include<stdio.h>
#include<conio.h>
  int main()
  {
    int a[10];
    int i;
    int greatest;
    printf("Enter ten values:");
    for (i = 0; i < 10; i++)
            {
    scanf("%d", &a[i]);
    }
    greatest = a[0];
    for (i = 0; i < 10; i++)
            {
if (a[i] > greatest)
 {
greatest = a[i];
    }
}
    printf("Greatest of ten numbers is %d",greatest);
    return 0;
  }

 Output




Related Post:-
Addition of two number using C
Add Two Matrices

What is C language and describe the main characteristics.

Some of the most important Point of coding

Post a Comment

0 Comments

Copyright (c) 2019 Designed by Shubham tiwari All Right Reseved