Академический Документы
Профессиональный Документы
Культура Документы
Page 1 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
4.3) BACKGROUND
CodeBlocks is an open source platform with full-featured integrated development environment
(IDE). The version used in this course is 13.12 rev 9501 and is made available at
www.codeblocks.org.
Page 2 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
3. Click on Console application icon and click Go. Click Next on Console Application wizard as
shown in Figure 3.3.
5. Type Worksheet 4 as project title and click Next as shown in Figure 3.5
Page 5 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Page 6 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Page 7 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
4. Copy and paste the following code to replace Hello world! code. Click Build and Run.
What is the output? Print screen the output and insert right after the code.
#include <stdio.h>
int main()
{
printf("I like programming in C.\n");
return 0;
}
Page 8 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
6. Now, copy and paste the following code (from Worksheet 2) and execute the program.
/*
* Calculates and displays the area and circumference of a circle
*/
#include <stdio.h>
#define PI 3.14159
int
main()
{
double radius, /* input radius of circle*/
area, /* output radius of circle*/
circum; /* output radius of circle*/
return(0);
}
7. Enter 5 for radius of the circle. Print screen and insert the output below.
Page 9 of 10
Prepared By Sarveswaren May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Page 10 of 10
Prepared By Sarveswaren May 2015