Advertisement
Raul_julian

Overflow-[OBI]

Jun 17th, 2013
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int A, B, result, maximo;
  6.     char carac;
  7.  
  8.     scanf("%d", &maximo);
  9.     scanf("%d %c %d", &A, &carac, &B);
  10.     if(carac == '+') result=A+B;
  11.     else result=A*B;
  12.     if(result>maximo) printf("OVERFLOW");
  13.     else printf("OK");  
  14.    
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement