Input : Please input 10 numbers : 2 3 45 1 89 10 32 67 98 100
Output : Smallest number is 1
Greatest number is 100
Gre0
Output : Smallest number is 1
Gre0
- #include<stdio.h>
- void main()
- {
- int arr[10], smallest, greatest;
- printf("Please input 10 numbers : ");
- for(int i=0; i<10; i++){
- scanf("%d", &arr[i]);
- }
- for(int i=0; i<10; i++){
- if(smallest > arr[i])
- smallest = arr[i];
- else
- greatest = arr[i];
- }
- printf("Smallest number is %d\n", smallest);
- printf("Greatest number is %d\n", greatest);
- }
একটি মন্তব্য পোস্ট করুন