#include<iostream>
int main()
{
int a=40;
int b=2;
std::cout<<a<<'+'<<b<<'='<<a+b<<std::endl;
}
Output:
40+2=42
int first_number = 0; // first number to add
int second_number = 0; // second number to add
int sum = first_number + second_number; // addition
printf ("x")
You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....
how to write a program that counts automorphic number from 1 to 999
Don't write, it is already written, google for 'cpp'.
Divide it by 1000.
int x= 1; int y= 2;
printf ("x")
To swap two variables without using a third variable, use exclusive or manipulation... a ^= b; b ^= a; a ^= b;
You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....
I don't think its possible. Every C++ program must at least have the main function.
#include<iostream> using namespace std; int main(int argc,char *argv[]){ int num1,num2; cout << "Enter the first number" << endl; cin >> num1; cout << "Enter the second number" << endl; cin >> num2; cout << "(" << num1 << " " << num2 << " )\n"; return 0; }
how to write a program that counts automorphic number from 1 to 999
Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.
By learning how to program on C+.
Don't write, it is already written, google for 'cpp'.
No.
Divide it by 1000.