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

Electromechanical Engineering Faculty of Engineering Somali National University Course Name: Elementary Programing Concept Course Code: EPC 2309

This document contains lecture notes on data types in C programming from Abdikadir Yusuf at Somali National University. It discusses primary data types like void, int, char, float, and double. It also mentions derived data types like arrays, references, and pointers as well as user-defined types like structures, unions, and enumerations. The key primary data types are described along with how variables are declared with a specific data type.

Uploaded by

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

Electromechanical Engineering Faculty of Engineering Somali National University Course Name: Elementary Programing Concept Course Code: EPC 2309

This document contains lecture notes on data types in C programming from Abdikadir Yusuf at Somali National University. It discusses primary data types like void, int, char, float, and double. It also mentions derived data types like arrays, references, and pointers as well as user-defined types like structures, unions, and enumerations. The key primary data types are described along with how variables are declared with a specific data type.

Uploaded by

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

Electromechanical Engineering

Faculty of Engineering
Somali National University

Course Name : Elementary Programing Concept


Course code : EPC 2309

Abdikadir Yusuf
March 16, 2020
DATA TYPES
 Lecture Outline

1.Primary(Built-in) Data Types:


void, int, char, double and float.
2.Derived Data Types: ? As we will see later in the course
Array, References, and Pointers.
3.User Defined Data Types: As we will see later in the course
Structure, Union, and Enumeration.
DATA TYPES

A data-type in C programming is a set of values and is determined to act on


those values. C provides various types of data-types which allow the
programmer to select the appropriate type for the variable to set its value.

The data-type in a programming language is the collection of data with


values having fixed meaning as well as characteristics. Some of them are an
integer, floating point, character, etc. Usually, programming languages specify
the range values for given data-type.
C Data Types are used to:

• Identify the type of a variable when it declared.


• Identify the type of the return value of a function.
• Identify the type of a parameter expected by a function.
Primary data type

Every C compiler supports five primary data types:

As the name suggests, it holds no value and is generally


used for specifying the type of function or what it
void
returns. If the function has a void type, it means that
the function will not return any value.
int Used to denote an integer type.
char Used to denote a character type.
float, double Used to denote a floating point type.
int *, float *, char * Used to denote a pointer type.
 Declaration of primary date type with variable names

After taking suitable variable names, they need to be assigned with a data type.
This is how the data types are used along with variables:

Example
int age;
char letter;
float height, width;
 END

You might also like