Write a program to fill the entire screen with a smiling face. The smiling face has an ASCII value 1.
Write a program to fill the entire screen with a smiling face. The smiling face has an ASCII value 1.
- Get link
- X
- Other Apps
/*Program to calculate second smallest element using array
Author : Priyanshu , Date: April 21,2021*/
#include<stdio.h>
#include<conio.h>
main()
{
int arr[10000],size,i,temp,second;
clrscr();
printf("Enter size in between (1 to 10000) : ");
scanf("%d",&size);
for(i=0;i<size;++i)
{
printf("Enter element of array: ");
scanf("%d",&arr[i]);
}
temp = arr[0];
for(i=1;i<size;++i)
{
if(temp > arr[i] )
{
second =temp;
temp = arr[i];
}
else
{
if(temp <arr[i] && arr[i] < second)
{
second = arr[i];
}
}
}
printf("\nSecond smallest number using array: %d",second);
getch();
return(0);
}
Comments
Post a Comment