UVA Solution 465 – Overflow – Solution in C,C++

UVA Online Judge Solution 465 – Overflow | Volume 4
UVA Problem Link – 465 – Overflow

Problem Name: 465 – Overflow Solution
Problem Number : UVA – 465 – Overflow Code
Online Judge : UVA Online Judge Solution
Volume: 4
Solution Language : C plus plus

UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list

UVA Solution 465 – Overflow Code in C/CPP:

#include<stdio.h>
int main() {
double
a, b;
int
INF = 2147483647;
char
op, s[2000];
while
(gets(s)) {
printf("%sn", s);
sscanf(s, "%lf %c %lf", &a, &op, &b);
if
(a > INF)
puts("first number too big");
if
(b > INF)
puts("second number too big");
if
(op == '+' && a+b > INF)
puts("result too big");
if
(op == '*' && a*b > INF)
puts("result too big");
}

return
0;
}

Tags: UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list, UVA 465 code in C, UVA 465 – Overflow  code in C++, UVA 465 – Overflow solution in C, UVA 465 solution

By Maniruzzaman Akash

Maniruzzaman Akash is a freelance web developer with most popular Laravel PHP frameork and Vue JS

Leave a Reply

Your email address will not be published. Required fields are marked *