C program to find largest number of a list of numbers entered through keyboard

C program to find largest number of a list of numbers entered through keyboard

#include<stdio.h>
#include<conio.h>

void main()
{
int i,n,x,large=0;
clrscr(); //to clear the screen

printf(“How many numbers?”);
scanf(“%d”,&n);
for(i=0;i<n;++i)
{
printf(“nEnter number %d:”,i+1);
scanf(“%d”,&x);
if(x>large)
large=x;
}

printf(“nnThe largest number is %d”,large);
getch(); //to stop the screen
}

1 thought on “C program to find largest number of a list of numbers entered through keyboard”

  1. If the user inputs 1234 the oitput should be like this

    01234
    1234
    234
    34
    4
    Or if the user inputs 1456 it should be like

    01456
    1456
    456
    56
    6

Leave a Comment

Your email address will not be published. Required fields are marked *