Skip to content
C Programming – Development Steps and IDE

Introduction to C Programming

Learning Objective: Understand the basic steps involved in developing a C program, learn about IDEs, understand Code::Blocks keyboard shortcuts, and practice writing simple C programs.

1. Steps in Development of a C Program

Developing a C program involves several stages. The programmer first writes the source code and then converts it into an executable program that the computer can run.

1 Enter, Edit and Save

Write the C source code using a text editor or an IDE and save the file with the .c extension.

Examples: Notepad, Notepad++, Sublime Text, VS Code, Code::Blocks.

2 Translate the Source Code

The source code must be translated into a form that the computer can understand.

A compiler translates C source code into machine/object code.

3 Linking

The linker combines the object code with required library routines and other necessary code.

For example, functions such as printf() are provided through standard libraries.

4 Test and Debug

Run the program and check whether it produces the expected output.

Errors are identified and corrected during debugging.

5 Create Executable Program

After successful compilation and linking, an executable program is created.

The executable can then be run by the operating system.

2. Program Development Process

Source Code
.c file
Compiler
Object / Machine Code
Linker
Executable Program
Run & Test
Note: In modern C development environments, many of these steps are performed automatically when you choose options such as Build or Build and Run.

3. IDE – Integrated Development Environment

IDE stands for Integrated Development Environment.

An IDE is software that provides the facilities required to develop programs and manage software projects. It usually combines a source-code editor, compiler/build tools, debugger, and other development features in one application.

Features of an IDE

  • Writing and editing source code
  • Compiling programs
  • Building and running programs
  • Finding and fixing errors
  • Debugging programs
  • Managing project files
Tip: Some IDEs support more than one programming language. For example, an IDE may provide tools for C, C++, Python, Java, and other languages.

4. Online Compilers

We can also practice programming using online compilers. An online compiler allows us to write, compile, and execute programs through a web browser without installing a compiler locally.

Online compilers are especially useful for beginners because they allow students to quickly test small programs.

5. Popular IDEs / Editors for C Programming

IDE / Editor Description
Turbo C A classic environment historically used for learning C.
Code::Blocks A free, open-source IDE commonly used for C and C++.
Dev-C++ A lightweight development environment commonly used for C and C++ programming.
VS Code A lightweight, extensible source-code editor that can be configured for C/C++ development.

6. Keyboard Shortcuts in Code::Blocks

Action Keyboard Shortcut
Zoom In Ctrl + +
Zoom Out Ctrl + –
Copy Ctrl + C
Cut Ctrl + X
Paste Ctrl + V
Build and Run F9

7. Program 1 – Display a Welcome Message

This program demonstrates how to display a simple message on the screen.

C Program
#include <stdio.h>

int main()
{
    printf("Welcome to C Programming");

    return 0;
}

Output

Welcome to C Programming
Explanation:
  • #include <stdio.h> includes the standard input/output library.
  • printf() displays text on the screen.
  • return 0; indicates successful completion of the program.

8. Program 2 – Display the Value of a Number

This program demonstrates how to declare an integer variable, assign a value to it, and display the value using printf().

C Program
#include <stdio.h>

int main()
{
    int x;

    x = 10;

    printf("Value of x is %d", x);

    return 0;
}

Output

Value of x is 10
Explanation:
  • int x; declares an integer variable named x.
  • x = 10; assigns the value 10 to x.
  • %d is a format specifier used to display an integer value.
  • The value of x is supplied to printf() after the format string.

9. Program 3 – Add Two Numbers

This program demonstrates how to store two numbers in variables, add them, and display their sum.

C Program
#include <stdio.h>

int main()
{
    int a, b;

    a = 15;
    b = 25;

    int sum = a + b;

    printf("Sum of the numbers is %d", sum);

    return 0;
}

Output

Sum of the numbers is 40
Explanation:
  • int a, b; declares two integer variables.
  • a = 15; stores 15 in a.
  • b = 25; stores 25 in b.
  • int sum = a + b; adds the two values and stores the result in sum.
  • Since 15 + 25 = 40, the output is 40.

10. Important C Programming Concepts Used

Concept Example Purpose
Header file #include <stdio.h> Provides standard input/output functions.
Variable declaration int x; Declares an integer variable.
Assignment x = 10; Stores a value in a variable.
Arithmetic operator a + b Adds two values.
Output function printf() Displays output on the screen.
Format specifier %d Used to display an integer.

11. Practice Questions

A. Multiple Choice Questions

1. What does IDE stand for?
  1. Integrated Development Environment
  2. Internet Development Editor
  3. Integrated Data Editor
  4. Internal Development Engine
2. Which extension is normally used for a C source file?
  1. .cpp
  2. .java
  3. .c
  4. .exe
3. Which function is commonly used to display output in C?
  1. input()
  2. printf()
  3. display()
  4. show()
4. Which format specifier is used for an integer?
  1. %c
  2. %f
  3. %d
  4. %s

B. Short Answer Questions

1. What is a C source code file?
2. What is the purpose of a compiler?
3. What is the role of a linker?
4. What is an IDE?
5. Name any four IDEs or editors that can be used for C programming.
6. What is the purpose of debugging?

C. Programming Practice

1. Write a C program to display your name.
2. Write a C program to display your school/college name.
3. Write a C program to store the value 50 in a variable and display it.
4. Write a C program to add 20 and 30 and display the result.
5. Write a C program to subtract 15 from 50 and display the result.
6. Write a C program to multiply two numbers and display the result.
7. Write a C program to calculate the average of two numbers.
8. Write a C program that stores your age in an integer variable and displays it.

12. Debugging Activity

Find and correct the errors in the following program:

Find the Errors
#include <stdio.h>

int main()
{
    int a, b
    a = 10;
    b = 20;

    printf("Sum = %d", a + b)

    return 0;
}
Hint: Check whether all statements have the required semicolon ;.

13. Quick Revision

Write CodeCompileLinkDebugBuild ExecutableRun

Remember: A C program generally starts execution from the main() function. The printf() function is commonly used to display output, and %d is used with printf() to display integer values.
C Programming Notes
Learn → Practice → Compile → Debug → Run