+ 2
How to write a c++programe
5 Respostas
+ 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;
}
+ 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
+ 5
Make specific questions.
+ 2
thanx