KEMBAR78
C Programming Basics for Students | PDF
0% found this document useful (0 votes)
67 views10 pages

C Programming Basics for Students

This document provides an introduction to C programming, covering character sets, variables, data types, and constants. It discusses that the C character set includes letters, digits, special characters, and white spaces. Variables are named references to values stored in memory, and must be declared before use. Variables can be initialized during or after declaration. Data types determine the set of values a variable can have and operations that can be performed on it, with C having numeric, character, and user-defined types. The document provides examples and demonstrations of these core C programming concepts.

Uploaded by

Kaushil Kundalia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views10 pages

C Programming Basics for Students

This document provides an introduction to C programming, covering character sets, variables, data types, and constants. It discusses that the C character set includes letters, digits, special characters, and white spaces. Variables are named references to values stored in memory, and must be declared before use. Variables can be initialized during or after declaration. Data types determine the set of values a variable can have and operations that can be performed on it, with C having numeric, character, and user-defined types. The document provides examples and demonstrations of these core C programming concepts.

Uploaded by

Kaushil Kundalia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Introduction to C Programming

(Character set, Variables and Data types)

Prof. Kuntal Patel


Ahmedabad University
Topics to be covered

• Introduction to C Programming

 C Character Set
 Variables
 Data types
 Constants
C Language - Character Set

Character set in C language are grouped under following


major categories:

 Letters (A…Z, a…z)


 Digits (0, 1, …9)
 Special Characters ( ; : , “ “ & * ! ,etc.)
 White spaces (Blank space, Tab, New line, etc.)

 C Tokens, Keywords and Identifiers


Examples / Demonstration
Variables
A variable is named link or reference to a value stored in the
memory.

Consider following declarations:


int rollno, marks;

In this statement:

 rollno and marks are variable name.


 int is a data type.

Examples / Demonstration
Variables

Declaring variables
Must declare variables before use

• Examples of Variable declaration:


int number;
float percentage;

• int - integer data type

• float -floating-point data type

• Many other types (will be discussing soon. . . )


Variables
Initializing variables
• Uninitialized variable assumes a default value/may results in
inappropriate value (Demonstration)

• Variables can be initialized using assignment operator (=)


number = 3;

Can also initialize at declaration:


float percentage = 81.60;

• Possible to declare/initialize multiple variables at once:


int a, b, c = 5, d = 10;
Data types
The data type of an object in memory determines

o the set of values it can have and

o what operations that can be performed on such objects (variable)

C has a small family of data types

• Numeric (int, float, double)


• Character (char)
• User defined (struct, union)
Data types

ANSI C Supports three classes of Data types:

 Primary data types

 Derived data types

 User-defined data types

Example / Demonstration and Discussion


Data types – Primary data type

Reference: Programming in ANSI C by E Balagurusamy


Topics covered

Key topics covered during session:

Important Aspects related to C Programming

 Character set
 Variables
 Data types
 Constants

You might also like