CODEBLOCKS IDE download latest version !

Code blocks is by far my favorite c++ editor software which has tons of options you need while making a program.It comes with Integrated Development Environment(IDE) which is extremely easy to use and it also supports graphical programming ,but I highly recommend QT creator if you want graphical programming .

codeblocks supports multiple compilers including GCC, Clang and Visual C++. It is developed in C++ using wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities and features are defined by the provided plugins. Currently, Code::Blocks is oriented towards C, C++, and Fortran.

Continue reading

Program to find sum of series “1+ 1/3! + 1/5! + 1/7! + ……………+ 1/n! “.

source code:

#include <iostream>
#include<iomanip>
#include<conio.h>
#include<math.h>

using namespace std;

int main()
{
    int num,i=1;
    double fact=1,sum=0;
    cout<<"Enter number : "<<endl;
    cin>>num;cout<<endl<<endl;

    while(i<=num)
    {
        if(i>1)
            fact=fact*(i-1)*i;

        sum=sum+(1/fact);
        i=i+2;
    }
    cout<<"Sum is "<<sum;
    getch();
}

Program to find “SUM OF DIGITS of a given number” using while loop.

source code:

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
  int number,r,rev=0;
  cout<<"Enter a number to find sum of its digits : ";
  cin>>number;cout<<endl;
  while(number>0)
     {
        r=number%10;
        rev=rev*10+r;
        number=number/10;
      }
  
  cout<<"Reverse is "<<rev;
  getch();
}

Program to find sum of the series “1+x+x^2+x^3+…………..+x^n”.

source code:

#include<iostream>
#include<conio.h>
#include<iomanip>
#include<math.h>

using namespace std;
int main()
{
    int x,n,i=0;
    long int sum=0;
    cout<<"Enter base and power :  ";
    cin>>x>>n;cout<<endl;
    for(i=1;i<=n;i++)
    {
        sum=sum+(pow(x,i));
    }
    cout<<sum;
    getch();
    return 0;
}

Program to find SUM OF FACTORIAL upto n.

source code:

 

#include <iostream>
#include<conio.h>
#include<iomanip>

using namespace std;

int main()
{
    int number,i=1,sum=0;
    long int fact=1;
    cout<<"Enter a positive integer to find its factorial :  ";
    cin>>number;
    for(i=1;i<=number;i++)
        {
            fact=fact*i;
            sum=sum+fact;
        }

    cout<<number<<"! = "<<sum;
    getch();
}

Get “QT CREATOR ” the best Graphical programming platform !

qt

Qt Creator is a cross-platform IDE (integrated development environment) tailored to the needs of a programmer who wants to develop programs which run graphically. Qt Creator includes the following features.

  • Code editor with C++, QML and ECMAscript support
  • Rapid code navigation tools
  • Syntax highlighting and code completion
  • Static code checking and style hints as you type
  • Support for source code refactoring
  • Context sensitive help
  • Code folding
  • Parenthesis matching and parenthesis selection modes

It also comes with a visual debugger .The editor’s features include syntax highlighting and auto completion, but not tabs. Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linu

 

Continue reading