 |
Learn C++ practicals
|
Hey, welcome back to another new and fresh blog here you will learn how to code in the C++ and also I will suggest you some software that can be helpful for you.
You will learn to code in C++ form starch and will the fun way. Don't be worry about any doubt I'm here to help you anytime. If you have any doubt contact me via the contact form.
So let's start coding...
Software list =
- Dev C++ (this is using in this blog)
- Turbo c++
- Code::blocks
These softwares that can be help you write the code you can download any software by clicking on that name
1. Hello world program
In this program, you will learn how to print any message in the console window but here we will print Hello World in this program.
Source code =
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
cout<<"Hello World !!!";
}
Output =
 |
2. Addition of two number program
In this program, you will learn how to add two numbers and we will take the number from the user and will go the addition of that number this is a very simple program.
Source code =
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int a,b;
int result;
cout<<"Enter first number = ";
cin>>a;
cout<<"\n Enter second number = ";
cin>>b;
result=a+b;
cout<<"\n Addition of the two number is = "<<result;
}
Output =
3. Subtraction of two number program
In this program, you will learn how to subtract two numbers this is much similar to the addition program. In this program also
we will take the two numbers form the user and will do the subtraction.
Source code =
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int a,b;
int result;
cout<<"Enter first number = ";
cin>>a;
cout<<"\n Enter second number = ";
cin>>b;
result=a-b;
cout<<"\n Subtraction of the two number is = "<<result;
}
Output =
Similarly, you can also perform multiplication division and an arithmetic operation so if you have any doubt in these programs so contact me I will help you definitely.
Thank you learning C++ form Technaman
|
No comments:
Post a Comment