Protected: Hello World
Protected: HACK ME CODE 5(Intro to string)
DETAILS
BEING A BLOG IT WILL BE UPDATED DAILY. DAILY YOU WILL BE PROVIDED WITH
MINIMUM 2 ILLUSTRATIONS,
1 DO IT YOURSELF QUESTION AND
SOLUTION OF TASK ASSIGNED.
HACK ME CODE 0
BASIC FORMAT
#include<iostream> // #is preprocessor
using namespace std;
int main() //main function
{
// DECLARE VARIABLE eg: int a,b;
//Perform function eg: cout<<“Product is”<<a*b;
return 0;
}
Note:: // is used to add single line comments. They are not read by compiler. They help the reader to understand the code in a better way.
HACK ME CODE 2
To add two numbers by taking data from user
#inlude<iostream>
using namespace std;
int main()
{
int a,b,sum;
cout<<“Enter first number”;
cin<<a;
cout<<“Enter second number”;
cout<<b;
sum=a+b;
cout<<“Sum of given numbers is”<<sum;
return 0;
}
HACK ME CODE 1
TO ADD TWO PREDEFINED NUMBERS USING C++
#include<iostream>
using namespace std;
int main()
{
int a,b,sum;
a=1;
b=2;
sum=a+b;
cout<<“Sum is”<<sum;
return 0;
}