int a = 1 + 2;
----------
int a = 1;
int b = 2;
a += b;
Not possible. Of course you can call a function which does the addition for you, but function-calling is also an operator in C.
substracion of any two number program in c
sum = a + b + c;
You do not need a header file to add two numbers in C. You do need the header files if you want to use the run-time library, which includes the ability to format and display the result.
#include<iostream.h> #include<conio.h> void main() { int a, b, c; clrscr(); cout<<"enter the two numbers"; cin>>a; cin>b; c=a+b; cout<<"Addition of two numbers="<<c; getch(); }
Get the input of two numbers from the user.a,bAdd those two numbers and store the value in another variable.c=a+b;print the value c
To find two numbers that multiply to give ( C ) and add up to ( B ), you can set up the equations ( x \cdot y = C ) and ( x + y = B ). These two equations can be solved simultaneously by substituting ( y ) from the second equation into the first, leading to a quadratic equation. The solutions to this equation will provide the two numbers you are looking for. If ( B^2 - 4C ) is non-negative, the numbers can be found using the quadratic formula.
You can also have any numbers like (a + c) and (b - c), where "c" is the irrational part, and "a" and "b" are rational.
The native C language will not permit the addition of two 100 digit numbers with native data types. Therefore, you need to simulate the 100 digit numbers differently, and that can be done various ways, including using an arbitrary precision math package, or BCD arithmetic, etc.
The following arithmetic operators are available in c:+ - addition -> used to add two numbers- - subtraction ->used to subtract two numbers* - multiplication ->used to multiply two numbers/ - division -> used to divide two numbers% - modulus -> used to determine the remainder when two numbers are divided. a%b return the remainder when a is divided by b(can be used with only integer data types).
There are an infinite number of such pairs. If a + b = 10 where a and b are rational, and if c is any irrational number, then x = a+c and y = b-c are both irrational numbers and x + y = a+c+b-c = 10
#include<stdio.h> int add(int pk,int pm); main() { int k ,i,m; m=2; k=3; i=add(k,m); printf("The value of addition is %d\n",i); getch(); } int add(int pk,int pm) { if(pm==0) return(pk); else return(1+add(pk,pm-1)); } </stdio.h>