+ 2

How to write a c++programe

10th Sep 2017, 2:36 PM
PURUSHOTTAM NIMJE
PURUSHOTTAM NIMJE - avatar
5 Respostas
29th Sep 2017, 3:54 PM
PURUSHOTTAM NIMJE
PURUSHOTTAM NIMJE - avatar
+ 10
1. Select the problem e.g., addition of 2 numbers. 2. Think what you need to do to solve the problem.i.e., make an algorithm. for e.g., 1. declare 3 variables a,b,c; 2. Input 2 numbers. 3. Add them and store in third // c=a+b; 4. Show the results. 3. Now just write the code . Sample Code : #include<iostream> using namespace STD; int main(){ int a,b,c; cout<<"enter 2 numbers"; cin>>a>>b; c=a+b; cout<<"\nresult="<<c; return 0; }
10th Sep 2017, 2:44 PM
P R
P R - avatar
+ 6
creating a file with .cpp extension using C++ syntax then using a compiler Windows : Code::Blocks for example Linux/Mac : g++ is a good one
10th Sep 2017, 2:43 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 5
Make specific questions.
10th Sep 2017, 2:42 PM
Dao
Dao - avatar
+ 2
thanx
10th Sep 2017, 2:48 PM
PURUSHOTTAM NIMJE
PURUSHOTTAM NIMJE - avatar