#include <stdio.h> #include <stdlib.h> int main() { int arr[5]={100,60,40,78,99}; int number; for(int i=0;i<5;i++) { printf("please enter numbers %d: ",i+1); scanf("%d",&arr[i]); } int min=arr[0]; int max=arr[0]; for(int i=0;i<5;i++) { if(arr[i]<min) min=arr[i]; if(arr[i]>max) max=arr[i]; } printf("\nmaximum number is %d: ",max); printf("\nminimum number is %d: ",min); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter