Practical 1 - CSU1128 - CSE 2026 - Shoolini University

Structure of a C Program and Difference between keywords, constants and Variables.

The structure of the C language is divided into four main parts:

Preprocessor Directives

These tell the compiler how to compile the program.

Variables and Data Types

Variables are containers that store data, and data types are used to define the type of data stored in a variable.

Functions

A function is a block of code that performs a specific task when called.

Statements and Expressions

These are instructions that tell the compiler how to execute the program.

Keywords

Keywords are predefined words in C language and are used to perform specific tasks.
Keywords cannot be used as variable names or identifiers as they are already reserved in the language.
They cannot be changed while writing the program.
Keywords are always written in lowercase letters.
Examples of keywords in C language are int, float, if, else, for, while, etc.

Constants

Constants are fixed values that do not change during the execution of a program.
They are also referred to as literals.
Constants can be either character constants, integer constants, floating-point constants, or string literals.
They can be written in capitals or lowercase letters.
Examples of constants in C language are 'A', 10, 3.14, and "Hello World".

Variables

Variables are used to store data in memory while the program is running.
They can be changed during the execution of a program.
Variables are user-defined and must be declared before they can be used in the program.
The value stored in a variable can be changed as per the requirement of the program.
Examples of variables in C language are int x; float y; char z; etc.
                    
/*
 * -----------------------------------------------------------
 * Logic Building with Computer Programming (CSU1128P)
 * Instructor: Abdullahi Adem | Author: Divya Mohan
 * 
 * This code is a part of the educational initiative by dmj.one
 * with aim of empowering and inspiring learners in the field of
 * Computer Science and Engineering through the respective courses.
 * 
 * (c) 2022, Divya Mohan for dmj.one. All rights reserved.
 * -----------------------------------------------------------
 */

#include <stdio.h>
int main()
{
    printf("Hello World \n");
    return 0;
}
                    
                

Output:

Hello World