In this tutorial, we are using a Turbo C++ compiler and integrated development environment (IDE), which is originally from Borland. What are the ways to run the C Program.
Example 1: WAP to print a Message "Hello World"
#include<stdio.h> #include<conio.h> void main() { clrscr(); printf("Hello World"); /* to print the statement */ getch(); }
There are 2 ways to compile and run the c program, by menu and by shortcut key.
Example 2: WAP to Input 2 numbers and find the sum. 1
#include<stdio.h> #include<conio.h> void main() { int a, b, c; clrscr(); printf("Enter 1st Number: "); scanf("%d",&a); printf("Enter 2nd Number: "); scanf("%d",&b); c=a+b; printf("Sum = %d",c); getch(); }