0% found this document useful (0 votes)
1 views8 pages

Computer ppt-1

This document provides an overview of variables and data types in C programming, emphasizing their importance for efficient program development. It covers definitions, scopes of variables, basic data types, user-defined data types, keywords, identifiers, and trigraph characters. Understanding these concepts is crucial for managing data and optimizing memory usage in C.

Uploaded by

papercloudds
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)
1 views8 pages

Computer ppt-1

This document provides an overview of variables and data types in C programming, emphasizing their importance for efficient program development. It covers definitions, scopes of variables, basic data types, user-defined data types, keywords, identifiers, and trigraph characters. Understanding these concepts is crucial for managing data and optimizing memory usage in C.

Uploaded by

papercloudds
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/ 8

1 2

Variables and Data Types


Understanding the fundamentals of C
programming.

SHREYA SAMANTA-11500224105
SHREYASI LAHA-11500224106
SIKRITI DAS-11500224107
SIMRAN BERA-11500224108
Introduction:
This presentation delves into the fundamental concepts of variables
and data types in C programming.Understanding these concepts is
essential for building robust and efficient programs.
Variables:
Scope of Variables :
Definition of Variables :
The scope of a variable refers to the region of a
In C, a variable is a named storage location in memory program where the variable is accessible.
that can hold a value. Variables in C can have different
The value of a variable can change during scopes: local, global, and file scope. Local variables are
program execution. Each variable declared within a function and can only be used inside
that function. Global variables are declared outside
must be declared with a specific data type, which determines
all functions and can be accessed from any part of the
the size and
program. Understanding variable scope is essential for managin
layout of the variable’s memory. data appropriately and avoiding naming conflicts.
Basic data types in C
C programming supports several basic data types including
integer (int), character (char), float, and double.
Integers store whole numbers, chars store single characters, and
floats and doubles represent real numbers with decimal points.
Choosing the correct data type is important for memory
optimization and precision in calculations.

1
User-defined data
types:
In C programming, a "user-defined data type" refers to a
custom data type created by the programmer using the
struct and union keywords, allowing for the grouping of
multiple variables of different data types into a single
entity, essentially creating a more complex data
structure tailored to specific needs; essentially, you can
define your own data type by combining existing basic
types like int, char, and float within a structure or union.
Key words and
identifiers:
 Every C word is classified as either a keyword or an
idernemer
 All keywords have fixed meanings and these meanings
be changed.
 Keywords serve as basic building blocks for program
statements.
 All keywords must be written in lower case.
 The underscore character is also permitted in identifiers.
 It is usually used a link between two words in long
identifiers
.
Trigraph
characters:
 C introduces the concept of trigraph sequences to
provide a way to enter certain characters that are not
available on keywords.

 Each trigraph sequence consists of three characters, 2


question marks followed by another character.

 Eg: ??= (number sign), ??)(right bracket]), ??( (left


bracket), ??! (vertical bar), ??< (left brace {). ??> (right
brace 1),??/ (back slash).
Thank you!

You might also like