Pages

C++ Programming Tutorials -1 (Basics)

tut1.cpp =

// This tut contains Hello world program
#include<iostream>
int main(){
    std::cout<<"Hello World";
    return 0;
}

tut3.cpp =

#include<iostream>
using namespace std;
//This programme was created by Nihal
/*this
is  
multi 
line 
comment*/
// This
// concept
// is
// called
// Comments.
int main(){
    int a=1,b=2,c=3;
    cout<<"Welcome to C++ programming:"<<a;
    cout<<"\nEnjoy programming with C++:"<<b;
    cout<<"\nLearn amazing concepts in C++:"<<c;
   

    return 0;
}


tut4.cpp =

#include<iostream>
using namespace std;
// This tut contains variable scope and data types

int glo = 6;
void sum(){
    int a;
    cout<<glo;
}


int main(){
    int glo=9;
    glo=78;

    int a=14,b=15;
    float pi=3.14;
    char c='d';
    bool is_truefalse;
    sum();
    cout<<glo<<is_true;
    

    cout<<"\nThis is tut 4.\nHere the value of a is :"<<a<<"\nHere the value of b is:"<<b;
    cout<<"\nThe value of pi is:"<<pi;
    cout<<"\nThe name of char is:"<<c

    return 0;

    

}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Top 10 Python Packages Every Developer Should Learn

Top 10 Python Packages Every Developer Should Learn There are more than  200,000 Python packages  in the world (and that’s just counting tho...