Skip to content
  • HOME
  • Courses
  • Events
  • Contact Us
  • About Nice
  • Login
Nice
  • bat
  • c compiler
  • C program
  • C PROGRAMMING Internal Assignment Examination
  • certificate-verification/
  • cf
  • Cf and Os Internal Assignment Examination
  • CF AND OS Mock Test For Practice Purpose
  • demo
  • DTP Internal Assignment Examination
  • dtpclass
  • Enquiry Form
  • error msg
  • exam link copy
  • Exam Preparation
  • exam-terminated
  • Examination
  • Forgot Password
  • Html Project (html+css+js)
  • imgedit
  • Instructor
  • Instructors
  • invoice
  • Log In
  • Login
  • NICE
  • note
  • OA Internal Assignment Examination
  • OA Mock Test For Practice Purpose
  • odia
  • OFFICE AUTOMATION Practices
  • OS
  • Password Recovery
  • Password Reset
  • PHOTOSHOP Internal Assignment Examination
  • Practices
  • Preparation qustion
  • Profile
  • Profile
  • PROJECT PDF
  • Project Submit Form
  • Register
  • res
  • Resize Image Online
  • Result
  • SELECTIVE
  • Selective Question Papers For 1st Semester PGDCA/ADCA
  • soft
  • student details
  • Submissions
  • TALLY Internal Assignment Examination
  • Terms and Conditions
  • test
  • Virus
  • WEB DESIGNING Internal Assignment Examination
  • WEB DESIGNING PROGRAM
  • wordfence_2fa_management
  • Log in
  • ID Card Form
  •  Admit Card Form
  • Enquiry Form
  • Students corner
  • News & Updates
  • Courses
  • Events
  • Student Login
  • Contact Us
  • About Nice
  • HOME PAGE
    • HOME
    • Courses
    • Events
    • Contact Us
    • About Nice
    • Login

    C program

    1. Home>
    2. C program
    How to download Turbo C++
    How to run a c program in visual studio code
    C "Hello, World!" Program
    Print your name
    How to download Turbo C++

    1. How to install Turbo C++?

    Step 1Download Turbo C++ 3.2 from here
    DOWNLOAD TURBO C++
    Step 2If any previous version of “Turbo C++” is installed on your computer, then first of all uninstall that.
    Step 3Extract the downloaded “Turbo C++ 3.2.zip” file.
    Step 4Run the “setup.exe” file.
    Step 5Follow the setup instructions.
    Step 6If any error occurs, please check the solution of common Turbo C++ issues here.

    2. How to use Turbo C++

    • Double-click on the “Turbo C++” shortcut link on the desktop.

     

    • If you want to run Turbo C++ on full screen simply click on the button “Start Turbo C++

     

    • “OR” If you do not want full-screen mode uncheck the “Full-screen mode” check box or Press F5 button

    3. System Requirement

    Operating SystemPre-Requirement
    Windows 11, 10, 8.1 and 8No Pre-Requirement
    Windows 7, Vista, and XP.NET 4.5 Framework Required

     

     

     

    to know some of the most used and the most important shortcuts used in Turbo C++.

     

    Turbo C++ Keyboard Shortcuts Keys:

    S No.Shortcut keysAction
    1.F1For Help
    2.F2Save
    3.F3Open
    4.F4Go to cursor
    5.F5Zoom
    6.F6Next
    7.F7Trace into
    8.F8Step over
    9.F9Make
    10.F10Menu
    11.Alt + F1Go to the previous Topic
    12.Alt + F3Close the opened file
    13.Alt + F4Inspect
    14.Alt + F5Open user screen/output screen
    15.Alt + F7Go to the previous Error
    16.Alt + F8Go to the next Error
    17.Alt + F9Compile
    18.Alt + 0Open a list of all available files
    19.Alt + COpen Compile menu option
    20.Alt + DOpen Debug menu option
    21.Alt + EOpen the Edit menu option
    22.Alt + FOpen File menu option
    23.Alt + HOpen the Help menu option
    24.Alt + OOpen the option menu
    25.Alt + POpen Project menu option
    26.Alt + ROpen Run menu option
    27.Alt + SOpen Search menu option
    28.Alt + WOpen Window menu option
    29.Alt + XQuit
    30.Alt + BkspUndo
    31.Alt + Bksp +  ShiftRedo
    32.Alt + EnterMinimize or Maximize
    33.Ctrl + DeleteDelete selected code
    34.Ctrl + F1Topic Search
    35.Ctrl + F2Reset Opened Program
    36.Ctrl + F3Call Stack
    37.Ctrl + F4Modify/Evaluate Expression
    38.Ctrl + F5Size/Move
    39.Ctrl + F7Add Watch
    40.Ctrl + F8Toggle between breakpoints
    41.Ctrl + F9  ‘or’  Alt + R + EnterRun code
    42.Ctrl + LSearch selected String
    43.Ctrl + NAdd New Line
    44.Ctrl + SSave
    45.Ctrl + YDelete Line
    46.Ctrl + InsCopy
    47.Ctrl + K + BSelect Starting Points
    48.Ctrl + K + KSelect Ending Points
    49.Ctrl + K + HHide Grey line of Selection
    50.WindowsExit
    51.Shift + DeleteCut
    52.Shift + Ins  ‘or’  Ctrl + K + CPaste
    53.Shift + F1Open Turbo Help Index
    How to run a c program in visual studio code

    How to run a C program in Visual Studio Code?

    A visual studio code is a lightweight software application with a powerful source code editor that runs on the desktop. It is a free source code editor developed by Microsoft for Windows, Mac OS and Linux. It is a software editor that has a rich extension of various languages like C++, C+, C, Java, Python, PHP, Go, etc. and runtime language extensions such as .NET and Unity. It is easy to edit, build, syntax highlighting, snippets, code refactoring and debugging. In Visual Studio code, we can change the application’s background theme, and keyboard shortcuts set on our preferences, install an extension and add additional functionality.

    Prerequisites for running a C program in Visual Studio Code

    1. We should have a basic knowledge of C programming.
    2. The Visual Studio Code Editor must be installed in the system.

      Download

    3. Download the C/C++ Extension. It is an extension provided by Microsoft that supports Visual Studio code. It helps in IntelliSense, debugging and code browsing of the programming code in the visual studio.
    4. Download the C/C++ compilers. There are some popular compilers are:
      1. GCC on Linux
      2. GCC via Mingw-w64 on Windows
      3. Microsoft C++ compiler on Windows
      4. Clang for XCode on MacOS

    We have already installed the Visual Studio Code in our system. The user interface of VS code looks like the following:

    How to run a C program in Visual Studio Code

    Download & Install the C/C++ Extension

    1. We need to click on the extension button that displays a sidebar for downloading and installing the C/C++ extension in the Visual Studio code. In the sidebar, type C Extension.

    How to run a C program in Visual Studio Code

    2. After that, click on the C/C++

     
    How to run a C program in Visual Studio Code

    In this image, click on the Install button to install the C/C++ extension.

    3. After clicking the Install button, it shows the below image.

    How to run a C program in Visual Studio Code

     

    In this image, we can see it shows the Uninstall button which means the C/C++ extension has been successfully downloaded in the Visual Studio code.

    Download and Install Compiler Extension

    A MinGW is an advanced GCC compiler software used to compile and execute code. It is software that supports only the Windows operating system.

    Download the MinGW-w64 Compiler

    1. Go to the https://sourceforge.net/projects/mingw We land on the following page.

     
    How to run a C program in Visual Studio Code
     

    2. After that, click on the Download button, and then it starts the downloading of the MinGW GCC compiler, as we can see in the image below.

    How to run a C program in Visual Studio Code

    3. MinGW software has been successfully downloaded into the system.

    How to run a C program in Visual Studio Code

    4. Now we double-click on the MinGW set-up to install the compiler.

    How to run a C program in Visual Studio Code

    As we can see, it shows that it is a harmful file click on the Run button to proceed with installing the setup.

    5. Click on the Install

    How to run a C program in Visual Studio Code

    6. Set it defaults, or we can change the storage location of the setup. After that, click on the Continue

    How to run a C program in Visual Studio Code

    7. Clicking the continue button shows step 2 of MinGW Installation Manager.

     
     
    How to run a C program in Visual Studio Code

    8. As we click on Continue, it shows the below image. In the MinGW Installation Manager, we need to check the Mingw32-base package and Ming32-gcc-g++ package to run and compile the C/ C++ program in the Visual Studio code editor.

    How to run a C program in Visual Studio Code

    9. After selecting the checkbox, click on the Installation tab (at the top left corner of the dialogue box).

    How to run a C program in Visual Studio Code

    Here we click on Apply Changes to set the package’s installation in MinGW, as given below.

     
     
    How to run a C program in Visual Studio Code

    10. After clicking on the Apply button, it shows the below image.

    How to run a C program in Visual Studio Code

    11. After downloading the packages, it shows the installation process of the package, as shown below.

    How to run a C program in Visual Studio Code

    Here we can see all the changes have been successfully applied and then click on the Close button.

    Set the Environment Path for the MinGW Set Up

    After downloading and installing the MinGW compiler, we set the environment path to include the C/C++ compiler directory.

    1. Go to the installation directory of the MinGW Set Up. Here we installed the setup on the C drive, as shown below.

    How to run a C program in Visual Studio Code

    2. Double-click on the MinGW folder. It shows the below image.

    How to run a C program in Visual Studio Code

    3. After that, click on the bin folder and then copy the directory path, as shown below.

    How to run a C program in Visual Studio Code

    Here is the path of the MinGW folder path: C:\MinGW\bin

    4. After copying the directory path, go to This PC -> Right Click on This PC -> Select/ Click on the Properties. It shows the below image.

    How to run a C program in Visual Studio Code

    5. After that, click on the Advanced system settings to display a popup box of System Properties, as shown below.

    How to run a C program in Visual Studio Code

    6. Click on the Environment Variables to set the directory path, as shown below.

    How to run a C program in Visual Studio Code

    First, we have to click on the System Variables Path and then click on the Edit button, as shown in the above image.

    7. As we click on the Edit button, it shows a popup window to set a new path, as shown below.

    In the above image, first, we click on the New button and then paste the C:\MinGW\bin path; after that, click the OK button.

    How to run a C program in Visual Studio Code

    8. Similarly, click the OK button on the Environment Variables and System Properties.

    9. If we want to check that the MinGW has been successfully installed in the system: go to the Command Prompt or cmd, write the GCC -version, and press the Enter

    How to run a C program in Visual Studio Code

     

    Start Coding in the Visual Studio Code Editor

    1. Here we created a C Program folder to store all program code. We can create a folder with any name in any directory.

    How to run a C program in Visual Studio Code

    2. Go to the VS Code and click on the Add Folder.

    How to run a C program in Visual Studio Code

    3. As we click on the Add Folder, it shows a popup dialogue box to select the folder to store the program.

    How to run a C program in Visual Studio Code

    4. After selecting the folder, click on the Add The selected folder appears in the Explorer section, as we have shown below.

    How to run a C program in Visual Studio Code

    5. Move the mouse over the C PROGRAM folder; it shows a + Click on the button and write the file name as Nicebhawanipatna. c, as shown below.

     
    How to run a C program in Visual Studio Code

    Now write and understand simple C programming in the VS Code editor.

    nicebhawanipatna. c

     
    1. #include<stdio.h> // define the header file
    2. void main()   // define the main function
    3. {
    4.     printf(“Welcome to nicebhawanipatnat”);  // print the statement.
    5. }

    How to run a C program in Visual Studio Code

    After writing the code, right-click on the program, as shown below.

    How to run a C program in Visual Studio Code

    Click on the Run Code option or press Ctrl + Alt + N from the button. It shows the following output.

     
    1. Welcome to nicebhawanipatna

    Let’s write a program to calculate the area and perimeter of the rectangle in the VS Code editor.

    Rectangle. c

     
    1. #include<stdio.h> // header files
    2. #include<conio.h>
    3. void main()
    4. {   // initialize the local variables.
    5.     int l =5, b=10, ar, pr;
    6.     printf(“Length & Breadth of the rectangle is: %d & %d”,l, b);
    7.     ar = l * b; // calculate area of rectangle.
    8.     pr = 2 * (l + b); // calculate perimeter of rectangle.
    9.     printf(“\n Area of Rectangle is: %d”, ar);
    10.     printf(“\n Perimeter of Rectangle is: %d”, pr);
    11. }

    We can click on the Run button or press the Ctrl + Alt + N from the keyboard. It displays the below output.

    How to run a C program in Visual Studio Code

    Let’s write another C program to take input from the user in the Visual Studio Code Editor.

    Rectangle2.c

     
    1. #include<stdio.h>
    2. int main()
    3. {   // initialize the local variables.
    4.     int l, b, ar, pr;
    5.     printf(“Enter the length of the rectangle”);
    6.     scanf(“%d”, l); // take input from the user
    7.     printf(“Enter the breadth of the rectangle”);
    8.     scanf(“%d”, b);
    9.     ar = l * b; // calculate the area of rectangle.
    10.     pr = 2 * (l + b); // calculate the perimeter of rectangle.
    11.     printf(“\n Area of Rectangle is: %d”, ar);
    12.     printf(“\n Perimeter of Rectangle is: %d”, pr);
    13. }

    When we click on the Run button or press the Ctrl + Alt + N, it displays the below output.

    In the above program, we take length and breadth as input from the keyboard. As the program is compiled, it produces the below statement.

    How to run a C program in Visual Studio Code

    Here Output tab is read-only, and hence we cannot take any input from the user. So, we need to add some steps in the code editor to take user inputs from the console/user.

    Following are the steps to take input from the user.

    1. First of all, we need to stop the background running the c program by pressing the Alt + Ctrl + M from the keyboard.
    2. After stopping the C file, go & click the File button at the top left corner of the Visual Studio Code Editor, and select Settings via Preferences, as shown below image.
      How to run a C program in Visual Studio Code
    3. After clicking the Settings, it shows the image below.
      How to run a C program in Visual Studio Code
      In this image, select the extension button to set the settings for the C Compiler.
    4. Click on the Extension button and scroll the drop-down box to select the Run Code Configuration.
      How to run a C program in Visual Studio Code
    5. Now scroll the right-side pane and Tick on the Run In Terminal.
      How to run a C program in Visual Studio Code
    6. Go to the c and again execute the program by clicking on the Run, it produces the following results, as shown below.
      How to run a C program in Visual Studio Code
    C "Hello, World!" Program

    Program to Display “Hello, World!”

     
    #include <stdio.h>
    #include <conio.h> void main() { // printf() displays the string inside quotation printf("Hello, World!"); getch(); }
    Run Code

    Output

    Hello, World!
    

    Print your name

    Program to Display “YOUR NAME”

     
    #include <stdio.h>
    #include <conio.h> void main() { // printf() displays the name inside quotation printf("My name is dev."); getch(); }
    Run Code

    Output

    My name is dev.
    Copyright - WordPress Theme by OceanWP
    Log In ×
    Forgot your Password?
    Don't have an account?
    Signup
    Resend OTP(00:60)
    Back to login

    Resend OTP (00:60)
    Back to login
    • (+93) Afghanistan
    • (+355) Albania
    • (+213) Algeria
    • (+1) American Samoa
    • (+376) Andorra
    • (+244) Angola
    • (+1) Anguilla
    • (+1) Antigua
    • (+54) Argentina
    • (+374) Armenia
    • (+297) Aruba
    • (+61) Australia
    • (+43) Austria
    • (+994) Azerbaijan
    • (+973) Bahrain
    • (+880) Bangladesh
    • (+1) Barbados
    • (+375) Belarus
    • (+32) Belgium
    • (+501) Belize
    • (+229) Benin
    • (+1) Bermuda
    • (+975) Bhutan
    • (+591) Bolivia
    • (+599) Bonaire, Sint Eustatius and Saba
    • (+387) Bosnia and Herzegovina
    • (+267) Botswana
    • (+55) Brazil
    • (+246) British Indian Ocean Territory
    • (+1) British Virgin Islands
    • (+673) Brunei
    • (+359) Bulgaria
    • (+226) Burkina Faso
    • (+257) Burundi
    • (+855) Cambodia
    • (+237) Cameroon
    • (+1) Canada
    • (+238) Cape Verde
    • (+1) Cayman Islands
    • (+236) Central African Republic
    • (+235) Chad
    • (+56) Chile
    • (+86) China
    • (+57) Colombia
    • (+269) Comoros
    • (+682) Cook Islands
    • (+225) Côte d'Ivoire
    • (+506) Costa Rica
    • (+385) Croatia
    • (+53) Cuba
    • (+599) Curaçao
    • (+357) Cyprus
    • (+420) Czech Republic
    • (+243) Democratic Republic of the Congo
    • (+45) Denmark
    • (+253) Djibouti
    • (+1) Dominica
    • (+1) Dominican Republic
    • (+593) Ecuador
    • (+20) Egypt
    • (+503) El Salvador
    • (+240) Equatorial Guinea
    • (+291) Eritrea
    • (+372) Estonia
    • (+251) Ethiopia
    • (+500) Falkland Islands
    • (+298) Faroe Islands
    • (+691) Federated States of Micronesia
    • (+679) Fiji
    • (+358) Finland
    • (+33) France
    • (+594) French Guiana
    • (+689) French Polynesia
    • (+241) Gabon
    • (+995) Georgia
    • (+49) Germany
    • (+233) Ghana
    • (+350) Gibraltar
    • (+30) Greece
    • (+299) Greenland
    • (+1) Grenada
    • (+590) Guadeloupe
    • (+1) Guam
    • (+502) Guatemala
    • (+44) Guernsey
    • (+224) Guinea
    • (+245) Guinea-Bissau
    • (+592) Guyana
    • (+509) Haiti
    • (+504) Honduras
    • (+852) Hong Kong
    • (+36) Hungary
    • (+354) Iceland
    • (+91) India
    • (+62) Indonesia
    • (+98) Iran
    • (+964) Iraq
    • (+353) Ireland
    • (+44) Isle Of Man
    • (+972) Israel
    • (+39) Italy
    • (+1) Jamaica
    • (+81) Japan
    • (+44) Jersey
    • (+962) Jordan
    • (+7) Kazakhstan
    • (+254) Kenya
    • (+686) Kiribati
    • (+965) Kuwait
    • (+996) Kyrgyzstan
    • (+856) Laos
    • (+371) Latvia
    • (+961) Lebanon
    • (+266) Lesotho
    • (+231) Liberia
    • (+218) Libya
    • (+423) Liechtenstein
    • (+370) Lithuania
    • (+352) Luxembourg
    • (+853) Macau
    • (+389) Macedonia
    • (+261) Madagascar
    • (+265) Malawi
    • (+60) Malaysia
    • (+960) Maldives
    • (+223) Mali
    • (+356) Malta
    • (+692) Marshall Islands
    • (+596) Martinique
    • (+222) Mauritania
    • (+230) Mauritius
    • (+262) Mayotte
    • (+52) Mexico
    • (+373) Moldova
    • (+377) Monaco
    • (+976) Mongolia
    • (+382) Montenegro
    • (+1) Montserrat
    • (+212) Morocco
    • (+258) Mozambique
    • (+95) Myanmar
    • (+264) Namibia
    • (+674) Nauru
    • (+977) Nepal
    • (+31) Netherlands
    • (+687) New Caledonia
    • (+64) New Zealand
    • (+505) Nicaragua
    • (+227) Niger
    • (+234) Nigeria
    • (+683) Niue
    • (+672) Norfolk Island
    • (+850) North Korea
    • (+1) Northern Mariana Islands
    • (+47) Norway
    • (+968) Oman
    • (+92) Pakistan
    • (+680) Palau
    • (+970) Palestine
    • (+507) Panama
    • (+675) Papua New Guinea
    • (+595) Paraguay
    • (+51) Peru
    • (+63) Philippines
    • (+48) Poland
    • (+351) Portugal
    • (+1) Puerto Rico
    • (+974) Qatar
    • (+242) Republic of the Congo
    • (+40) Romania
    • (+262) Runion
    • (+7) Russia
    • (+250) Rwanda
    • (+290) Saint Helena
    • (+1) Saint Kitts and Nevis
    • (+508) Saint Pierre and Miquelon
    • (+1) Saint Vincent and the Grenadines
    • (+685) Samoa
    • (+378) San Marino
    • (+239) Sao Tome and Principe
    • (+966) Saudi Arabia
    • (+221) Senegal
    • (+381) Serbia
    • (+248) Seychelles
    • (+232) Sierra Leone
    • (+65) Singapore
    • (+1) Sint Maarten
    • (+421) Slovakia
    • (+386) Slovenia
    • (+677) Solomon Islands
    • (+252) Somalia
    • (+27) South Africa
    • (+82) South Korea
    • (+211) South Sudan
    • (+34) Spain
    • (+94) Sri Lanka
    • (+1) St. Lucia
    • (+249) Sudan
    • (+597) Suriname
    • (+268) Swaziland
    • (+46) Sweden
    • (+41) Switzerland
    • (+963) Syria
    • (+886) Taiwan
    • (+992) Tajikistan
    • (+255) Tanzania
    • (+66) Thailand
    • (+1) The Bahamas
    • (+220) The Gambia
    • (+670) Timor-Leste
    • (+228) Togo
    • (+690) Tokelau
    • (+676) Tonga
    • (+1) Trinidad and Tobago
    • (+216) Tunisia
    • (+90) Turkey
    • (+993) Turkmenistan
    • (+1) Turks and Caicos Islands
    • (+688) Tuvalu
    • (+1) U.S. Virgin Islands
    • (+256) Uganda
    • (+380) Ukraine
    • (+971) United Arab Emirates
    • (+44) United Kingdom
    • (+1) United States
    • (+598) Uruguay
    • (+998) Uzbekistan
    • (+678) Vanuatu
    • (+58) Venezuela
    • (+84) Vietnam
    • (+681) Wallis and Futuna
    • (+212) Western Sahara
    • (+967) Yemen
    • (+260) Zambia
    • (+263) Zimbabwe
    NICE INSTITUTE
    • HOME
    • Courses
    • Events
    • Contact Us
    • About Nice
    • Login