#include<iostream>
int main
{
int x=40, y=2;
std::cout<<"The sum of "<<x<<" and "<<y<<" is "<<x+y<<std::endl;
}
#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(); }
Let c = a+b
It has nothing to do with C, it simply means: add 1 to a variable.
Object oriented programming and structured programming.
#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>
sum = a + b + c;
int main() { int x = 40 + 2; }
C is a programming language. Example of C or C++ Programing would be the following: add matrices, get ip address, and read files.
#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(); }
Let c = a+b
It has nothing to do with C, it simply means: add 1 to a variable.
Primarily to add object oriented programming methods to the C language.
Add the numbers, then divide by three. I don't know vb script, but in most programming languages it would be something like this: result = (a + b + c) / 3
Object oriented programming and structured programming.
#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>
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.
Not possible. Of course you can call a function which does the addition for you, but function-calling is also an operator in C.