Professional Documents
Culture Documents
Cpi C1
Cpi C1
185151Computer Practice I
Turbo C IDE Turbo C IDE facilitates editing, debugging and execution of applications written in C. C programs are saved with .c extension. Some of the shortcut keys are: Ctrl + F1 F2 F3 Copy Cut Paste Clear Help Save Open Ctrl + Ins Shift + Del Shift + Ins Ctrl + Del Alt + F9 Ctrl + F9 Alt + F5 F7 Alt + F3 Alt + X Compile Execute User Screen Trace Into Close Quit
cseannauniv.blogspot.com
C Programming
185151Computer Practice I
Algorithm
Step 1 : Step 2 : Step 3 : Step 4 : Step 5 : Step 6 : Step 7 : Start Define constant pi = 3.14 Read the value of radius Calculate area using formulae pi*radius2 Calculate circumference using formulae 2*pi*radius Print area and circumference Stop
Flowchart
Start
pi = 3.14
Stop
cseannauniv.blogspot.com
C Programming
185151Computer Practice I
Program
/* Area and circumference of a circle */ #include <stdio.h> #include <conio.h> #define pi 3.14 main() { int radius; float area, circum; clrscr(); printf("\nEnter radius of the circle : "); scanf("%d",&radius); area = pi * radius * radius; circum = 2 * pi * radius; printf("\nArea is %.2f and circumference is %.2f\n",area,circum); getch(); }
Output
Enter radius of the circle : 8 Area is 200.96 and circumference is 50.24
cseannauniv.blogspot.com