Add Them Up

Why use unsigned long long? :slight_smile:

1 Like

I have solved a Problem but that is just running for 2 minutes.
what is wrong ?

@Wasif_719 Can you please share the submission ID?

when I submit my coding…it shows that its running…but when I refresh the page… everytime I can only see complitation error…
what’s wrong??

It is because there are syntactical errors in your code. You need to make sure the code you have written is valid C code.

When you get Compilation Error, pay close attention to what is said in the submission page. It will tell you about the exact issues in your code.

A post was split to a new topic: Programming Help

I wrote this code and it is running in Python IDLE.

def add(a,b):
    if a < 20000000 and b <20000000:
        print(a+b)
    else:
        pass
a = int(input())
b = int(input())
add(a,b)

But it is showing runtime error. Why?

@amin2783
The numbers are in the same line not in separate lines.

try using,

a, b = map(int, input().split())

instead of

a = int(input())
b = int(input())

Got it, thanks @touhidur

1 Like
#include <stdio.h>

int main() {
	int a,b;
	scanf("%d,%d",&a,&b);
	printf("%d",a+b);
	return 0;
}

What is wrong?

scanf("%d,%d",&a,&b);
         ^ This comma

:rofl: :rofl: :rofl:
The human compilation version of GCC

1 Like

what is the mistake?

#include <stdio.h>
{
int main()
    int firstNumber, secondNumber, sumOfTwoNumbers;
    printf("Enter two integers: ");
    scanf("%d %d", &firstNumber, &secondNumber);
    sumOfTwoNumbers = firstNumber + secondNumber;
    printf("%d + %d = %d", firstNumber, secondNumber, sumOfTwoNumbers);
    return 0;
}
printf("%d + %d = %d", firstNumber, secondNumber, sumOfTwoNumbers);
        ^^^^^^^^^^

Just print the answer, nothing more, nothing else.

you have to take input one time from user using space. And after that split those values… like below:
a = input()
b = a.split(" ")
c =int(b[0])
d = int(b[1])

1 Like

Thanks for the help!

you must use sum integer . That means sum= A+B then printf(“%d”,sum ) ;

#include<conio.h>
int main()
{
int A,B,sum ;

scanf("%d",&A);
   scanf("%d",&B);

sum =A+B ;
printf(“%d”,sum);
return (0) ;

}

use (long long) only

Whats wrong?

A=int(input(""))
B=int(input(""))
Sum=A+B
print(Sum)