Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- user: hasib
- */
- #include<stdio.h>
- int main()
- {
- int n, half;
- int i;
- int maxResult = -1; //initializing with a very small value;
- scanf("%d", &n);
- half = n/2;
- for(i=0; i<=half; i++)
- {
- if(maxResult < (i+1)*(n-i+1) )
- {
- maxResult = (i+1)*(n-i+1);
- }
- }
- printf("%d\n", maxResult);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement