0% found this document useful (0 votes)
5 views9 pages

Understanding Data Types in C

This document discusses primary data types in C including integer, floating point, and character types. It explains how to declare variables of these types and assign them values. Variables can be declared individually or in groups on a single line. Constants can also be declared, which assign a variable a fixed value. Examples are provided of declaring and initializing different variable types with integer, floating point, character, and constant values.

Uploaded by

rangarajantr
Copyright
© Attribution Non-Commercial (BY-NC)
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)
5 views9 pages

Understanding Data Types in C

This document discusses primary data types in C including integer, floating point, and character types. It explains how to declare variables of these types and assign them values. Variables can be declared individually or in groups on a single line. Constants can also be declared, which assign a variable a fixed value. Examples are provided of declaring and initializing different variable types with integer, floating point, character, and constant values.

Uploaded by

rangarajantr
Copyright
© Attribution Non-Commercial (BY-NC)
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

Data Types in C

Objectives
After this Session, you will be able to understand Primary data types know how to declare variables assign values to variables

Primary Data Types

Integer Types

Floating Point Types

Character Types

Declaration & Assigning Values


The syntax is Data-type v1,v2..vn; Eg:[Link] count; [Link] ratio, total; ASSIGNING VALUES Variable_name=constant Eg:1) int a=20; 2) bal=75.84; 3) yes=x; C permits multiple assignments in one line. Example: initial_value=0;final_value=100;

Declaration
Declaring a variable as constant Eg: 1) const int class_size=40;

Check Your Progress


Ex 1) declare a few variables and initialize them

You might also like