#include<iostream>
int main
{
int x=40, y=2;
std::cout<<"The sum of "<<x<<" and "<<y<<" is "<<x+y<<std::endl;
}
Let c = a+b
It has nothing to do with C, it simply means: add 1 to a variable.
#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(); }
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.
Let c = a+b
It has nothing to do with C, it simply means: add 1 to a variable.
#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(); }
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>
Not possible. Of course you can call a function which does the addition for you, but function-calling is also an operator in C.
There are two programming languages which use a C switch statement. The two languages are C and C++, hence the name C switch statement. There may be more, but those are the most obvious ones