Hello Programmers In this post, you will know how to solve the Buggy Calculator Codechef Solution.Buggy Calculator Codechef SolutionOne more thing to add, don’t directly look for the solutions, first try to solve the problems of Codechef by yourself. If you find any difficulty after trying several times, then you can look for solutions.ProblemTrans bought a calculator at creatnx’s store. Unfortunately, it is fake. It has many bugs. One of them is adding two numbers without carrying. Example expression: 12 + 9 will have result 11 in his calculator. Given an expression in the form a + b, please output result from that calculator.InputThe first line contains an integer T denote the number of test cases. Each test case contains two integers a, b in a single line.OutputEach test case, print answer in a single line.Constraints1 ≤ T ≤ 1001 ≤ a, b ≤ 109Subtasks:Subtask #1 (30 points): 1 ≤ a, b ≤ 9Subtask #2 (70 points): original constrainsSample Input 1 2 12 9 25 25 Sample Output 1 11 40Buggy Calculator CodeChef Solutions in JAVAimport java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner sc = new Scanner(System.in); int tcases = sc.nextInt(); while(tcases-->0) { int a = sc.nextInt(); int b = sc.nextInt(); int sum=0; int count=0; while(a>0 || b>0) { int dig = ((a%10)+(b%10))%10; sum = dig*(int)Math.pow(10,count)+sum; a=a/10; b=b/10; count++; } System.out.println(sum); } } } Buggy Calculator CodeChef Solutions in CPP#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--){ int a,b,r1,r2,res,f=1,sum=0; cin>>a>>b; while(a>0 || b>0) { r1=a%10; r2=b%10; res=(r1+r2)%10; sum+=res*f; f*=10; a=a/10; b=b/10; } cout<<sum<<endl; } return 0; }Buggy Calculator CodeChef Solutions in Pythonimport math def xsum(a,b): multiplier=1 bit_sum=0 res=0 while(a or b): bit_sum=((a%10) +(b%10)) bit_sum=bit_sum%10 res=(bit_sum*multiplier)+res a=math.floor(a/10) b=math.floor(b/10) multiplier=multiplier*10 return res for i in range(int(input())): a,b=map(int,input().split()) print(xsum(a,b))Disclaimer: The above Problem (Buggy Calculator ) is generated by CodeChef but the solution is provided by BrokenProgrammers. This tutorial is only for Educational and Learning purposes.Note:- I compile all programs, if there is any case program is not working and showing an error please let me know in the comment section. If you are using adblocker, please disable adblocker because some functions of the site may not work correctly.Next: BST Operations Codechef Solution Post navigationBodybuilder Codechef Solution BST Operations Codechef Solution