Sum of two number in c++ programming | c++ coding | programming in c++ language | cpp programming

preview_player
Показать описание
sum of two number in c++ programming language
c++ coding,
cpp coding
Рекомендации по теме
Комментарии
Автор

C :

#include<stdio.h>
int main() {
int x = 5;
int y = 6;
int sum = x + y;
printf("%d, sum);
return 0;
}


Output : 11

savitajoshi
Автор

meanwhile in python



a=input(int(enter first num))

b=input(int(enter second num))

print(f"sum of {a} and {b} is", a+b )



amd thats all

neer
Автор

How can I get 30s of my life back. Do it using pointers.

satvikkhare
Автор

You should use

export inline template<typename Ty1, typename Ty2> requires (Ty1 obj1, Ty2 obj2) { obj1 + obj2; } auto get_sum(const Ty1& obj1, const Ty2& obj2)->decltype(obj1 + obj2)noexcept(noexcept(obj1 + obj2)){
return obj1 + obj2;
}

nyssc
Автор

Python
a=input(int(enter first number))
b=input(int(enter second number))
Print(f"sum of {a} and sum of {b} is", a+b)

we_four_DAPS
Автор

What about if you want the user to be able to enter more numbers for the sum without knowing how many numbers he will enter? Asking because that’s my homework for this week. Trying to figure out how to write a program for multiple numbers where as it outputs sum of even numbers, sum for odd numbers, and total sum.

djlystics
Автор

Y bhtt intrsting h yrr m to ab shuru krri hu seekhna i am b com krliya h ab complete but man h to bs seekhna h ye bhi i hope easy rho

zee
Автор

Use correct initialization int a{}, etc.

virno
Автор

Lol, std::cout instead of using namespace std😅

Merovingien
Автор

in cout, remove the quotes where a+b so the numbers that you entered instead of letters will be output

MARKUS-mcez
Автор

I was always doing cout << first No. <<
And then cin>> no. 1;
And then repeat with no. 2 but i see that i can just do cin >> a >> b;

Neonili
Автор

Sup fellow coder that uses android to code 👊😊😊

joshnathanielarcilla
Автор

Please 🙏 what is the name of the compiler I are using plz

Otakuisland-kmtp
Автор

Where is the enter button in the phone

hdhxevk
Автор

But you can make it with "switch" and "case" or also "if" and "else"

Fvlyme
Автор

It would have been better if you wrote:

cout<<a<<" + "<<b<<" = "<<sum;

Because here in the output it would have shown the numbers you have entered instead of 'a' and 'b'.

AadityaBhowmick
Автор

the horizontal and vertical whitespacing in this code is making me have a conniption

Kirjahri
Автор

Что такое return и надо ли это убрать?

oesrefl
Автор

guyz i wanna be ethical hacker what coding language should i learn?

vishnutejchennuru
Автор

I don’t think “using namespace std” is a healthy convention. In a larger codebase, you might accidentally overwrite one of the std functions if someone unknowingly writes a function with the same function name as a common std function

sheepuff