Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*maximum*/
- #include<stdio.h>
- int main()
- {
- int a[100], i, max = 0;
- for(i = 0; i<3; i++){
- scanf("%d", &a[i]);
- }
- max = a[0];
- for(i = 0; i<3; i++){
- if (max<a[i])
- max = a[i];
- }
- printf("Max: %d", max);
- return 0;
- }
- /*minimum */
- #include<stdio.h>
- int main()
- {
- int a[100], i, min = 0;
- for(i = 0; i<3; i++){
- scanf("%d", &a[i]);
- }
- min = a[0];
- for(i = 0; i<3; i++){
- if (min>a[i])
- min = a[i];
- }
- printf("Min: %d", min);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement