

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Computer Fundamental
Where to find Turbo C Turbo C is installed on all the systems in the lab, it is placed c:\TC (check your system for TC), if you want to use it on your own system, you can check \172.30.10.8\software\Programming Languages or can download from internet
Can we use a different IDE There are many IDEs available for programming in C/C++, e.g. Microsoft Visual C, Code::Block, Borland C, C Builder etc.
Copy Test.C from the lab folder i.e. \172.30.10.8\learningmaterial\Nauman Shamim\CF_2011\lab-01 and paste it to c:\TC\BIN folder Open TC 9 In windows Click Start button, select RUN, type cmd, this will open a black window on your PC, type cd
this will take you to C:\ now type cd tc it will change the director to tc you should see something like c:\tc now type cd bin, and now you should see c:\tc\bin type tc to execute turbo c OR
9 Click my computer, go to C:\TC\BIN , there you should find a file TC.exe , double click it to execute it
Now you should be in TC IDE , open test.c from file menu, after the file is opened press crt+f9 , if you see a success message your TC software is working fine, if there is no output or program donโt executes there is some problem, inform me is such case.
Create a New File in TC by clicking FileรNew, save the file as hello.c by clicking save from File menu or press F Write the following code in hello.c , and press F2 (to save the changes )
#include <stdio.h>
void main(void) { printf(โHello World โ);
}
Compile the code by pressing F The compilation results will tell you the number of lines compiled, warnings and errors, there should be zero errors for successful compilation, in case of error you should contact me. Execute the code by pressing CRT+F Output For this program there output will not be displayed (will explain in lab), add the following line at the top in hello.c #include <conio.h> Add the following line in the last (just before closing bracket } ) getch(); Compile and execute your program and you should see โHello Worldโ in console.
clrscr() It is a library function that clears the screen, when this function is executed any thing printed on the screen before this function will be cleared from the screen, for our program we will call this function in the beginning of our code in main so that the screen is cleaned before our printf prints anything on the screen #include <conio.h> #include <stdio.h> void main(void) { clrscr(); printf(โHello World โ); getch(); }