Sponsored Links

Thursday, July 17, 2014

Download and Install Turbo C++ Full Screen Windows 7 Vista

Today we will discuss How to Download and Install Turbo C++ With Full Screen IDE for Windows 7 and Vista.

What is Turbo C++?

Turbo C++ 3.0 is the most popular OLD is GOLD Compiler for C language and C++ Language. Students, normally, use Turbo C++ 3.0 for learning C / C++ programming. You can download and install Turbo C++ 3.0 in easy steps as follows:

Link for Download and Install Turbo C++ With Full Screen IDE for Windows 7 and Vista


Download and Install Turbo C++ With Full Screen IDE for Windows 7 and Vista

How To Install Turbo C++ With Full Screen IDE for Windows 7 and Vista.

       
    After you have downloaded the Turbo C++ installation zip file from mediafire, extract this file.

    Double click on the Turbo C++ installation file to start setup. Click on Next button.

     
    Download and Install Turbo C++ With Full Screen IDE for Windows 7 and Vista
    Accept the terms and click on install button.

    Download and Install Turbo C++ With Full Screen IDE for Windows 7 and Vista step 2
    Click on Finish button to end the setup. Congratulations! Now you can learn C++ computer programming in Turbo C++ IDE.

    Download and Install Turbo C++ With Full Screen IDE for Windows 7 and Vista step 3

    Click on start button and click on Turbo C++ icon.

    How To Run Turbo C++ With Full Screen IDE for Windows 7 and Vista
    Click on File menu and select New.

    How To Write First Program in Turbo C++ With Full Screen IDE for Windows 7 and Vista

    Type the first program as shown in the above picture. Click on RUN menu and select Run command. The output of the program will be shown as the following picture:

    How To Run First Program in Turbo C++ With Full Screen IDE for Windows 7 and Vista
    End of the C++ Tutorial How To Download, Install Turbo C++ With Full Screen IDE for Windows 7 and Vista and Write and Run First Program

    Tuesday, June 10, 2014

    C Plus Plus Program Conversion of Hours into Weeks Days Hours

    Today, we are going to discuss a simple program logic that uses only input, output and assignment statements along with variable declarations.

    Points of Discussion are:
    • C++ Program: Input Hours Convert into Weeks, Days and Hours.
    • Algorithm of the Hours Conversion Program
    • C++ Code of the Hours Conversion Program.
    • Understanding Logic of The Hours into Week, Day and Hours Program


    ALGORITHM : Hours Conversion


    1. Start
    2. Input Hours
    3. Calculate Weeks = Hours / 168
    4. Calculate Hours = Hours Mod 168
    5. Calculate Days = Hours / 24
    6. Calculate Hours = Hours Mod 24
    7. Display "Weeks=", Weeks
    8. Display "Days=", Days
    9. Display "Hours =", Hours
    10. End

    C++ Code: Program Hours Conversion into Weeks, Days and Hours.


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

    void main()
    {
          clrscr();
          int h, w, d, hrs;
          cout<<"Enter Hours=";
          cin>>hrs;
          h = hrs;
          w = hrs / 168;
          hrs = hrs % 168;
          d = hrs / 24;
          hrs = hrs % 24;
          cout<<"Total Hours input = "<<h<<endl;
          cout<<"Weeks ="<<w<<endl;
          cout<<"Days ="<<d<<endl;
          cout<<"Hours ="<<hrs;
          getch();
    }

    OUTPUT of Sample Run of The Program Hours Conversion


    Enter Hours= 200
    Total Hours input =200
    Weeks = 1
    Days =1
    Hours =8


    Logic of The Program Hours Conversion


    We know that:
    1 day = 24 hours
    so 1 week = 24 x 7 = 168 hours

    Therefore we will divide total hours by 168 to get weeks.
    weeks = 200 / 168 will give 1 week.
    Now to calculate remaining hours we will get remainder of the division 200 % 168
    This will give remaining hours = 32

    To get days, we will divide remaining hours by 24
    so 32 / 24 will give 1 day.

    Now we will calculate remaining hours by remainder 32 % 24 that will give the result 8 hours.

    So the output 1 week, 1 day and 8 hours.

    If you enjoyed the C++ Learning Through Example program Logic Understanding, Please share this blog on Social media. Thanks!

    Sunday, February 16, 2014

    Convert a Number into Reverse Number Program in C Plus Plus

    C++ Reverse Number Conversion Program Logic



    Q: Write a C++ Program to input an integer number and display its Reverse Number. For example if the input is the number 123, the Reverse Number will be 321.

    convert-reverse-number-program-c-plus-plus
    • First of all we suppose that the number entered is 123.
    •  Let the given number num = 123
    • Copy the number in temporary variable temp so that temp = 123

    First Iteration of While Loop

    • We start a while loop with condition temp>0. Since temp=123 so loop will start for first time.
    • Now we will divide number 123 by 10 so that the remainder R = 3 and Quotient Q = 12
    • Put the values in statement rev = rev * 10 + R
    • rev = 0 * 10 + 3
    • rev = 3
    • Assign the value of Quotient Q to temp so that temp = 12 now.
    • Since temp 12 is >0, so the while loop will execute again.
    •  

    Second Iteration of While Loop

    • Now we will divide number temp 12 by 10 so that the remainder R = 2 and Quotient Q = 1
    • Put the values in statement rev = rev * 10 + R
    • rev = 3 * 10 + 2
    • rev = 30+2
    • rev = 32
    • Assign the value of Quotient Q to temp so that temp = 1 now.
    • Since temp 1 is >0, so the while loop will execute again.

     Third Iteration of While Loop

    •  Now we will divide number temp 1 by 10 so that the remainder R = 1 and Quotient Q = 0
    • Put the values in statement rev = rev * 10 + R
    • rev = 32 * 10 + 1
    • rev = 320+1
    • rev = 321
    • Assign the value of Quotient Q to temp so that temp = 0 now.
    • Since temp 0 is not >0, so the condition temp>0 will evaluate to false so that the while loop will terminate.
    reverse-number-program-code-in-c-plus-plus

    Conclusion

           So the Required Reverse Number is 321.

    The Actual C++ Code of Reverse Number Program


    /*
    Program to input a number, then display its Reverse number.
    (c) Www.EasyCppProgramming.Blogspot.Com
    */


    #include<iostream.h>
    #include<conio.h>
    #include<math.h>
    void main()
    {
         int num, temp, rev=0, R, Q;

         clrscr();

         cout<<"Enter a number to reverse=";

         cin>>num;

         temp = num;

         while ( temp>0 )

         {

           Q = temp/10;
           R = temp % 10;
           rev = rev*10 + R;

           temp = Q;

         }

         cout<<"\n The Reverse Number = "<<rev;
         getch();

         }