Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int i,num;
- printf("Enter the size of the array :");
- scanf("%d", &num);
- float arr[num], max;
- printf("enter elements in the array : ");
- for(i=0; i<num ; i++)
- {
- scanf("%f", &arr[i]);
- }
- max= arr[0];
- for(i=1; i < num ; i++)
- {
- if(max<arr[i])
- {
- max=arr[i];
- }
- }
- printf("maximum value : %.2f", max);
- }
Advertisement
Add Comment
Please, Sign In to add comment