SCALAR AND COMPOSITE DATA TYPES TRB CSI › Programming with C++ › scalar and composite data types.

SCALAR AND COMPOSITE DATA TYPES

Scalar Data Type Scalar Data Type என்பது ஒரு நேரத்தில் ஒரே ஒரு atomic / single value-ஐ represent செய்யும் data type. Examples: Integer Floating Point Character Boolean Enumeration Pointer Programming language-ஐ பொறுத்து exact classificatio…

Premium — locked Advanced 21 min 100 cards 8 programs 13 MCQs v3
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock

SCALAR AND COMPOSITE DATA TYPES அதில் இரண்டு முக்கியமான ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int age = 25; age ஒரே ஒரு integer value வைத்திருக்கிறது. So, இத……

Premium This card is part of the premium lesson. Unlock
Definition

Scalar Data Type Scalar Data Type என்பது ஒரு நேரத்தில் ஒரே ஒரு atomic / single value-ஐ represent செய்யும் dat……

Premium This card is part of the premium lesson. Unlock
Simple Explanation

ஒரு student-ன் age மட்டும் store செய்ய வேண்டும். int age = 20; இங்கு: age ↓ 20 ஒரே value. இதனால்: Scalar ஆனால……

Premium This card is part of the premium lesson. Unlock
Flow

DATA TYPE | +-------------------------+ | | v v Scalar Composit……

Premium This card is part of the premium lesson. Unlock

SCALAR DATA TYPES

Definition

Scalar என்ற word-ன் basic meaning: Single quantity. Programming-ல்: ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int x = 10; x ↓ 10…

Premium This card is part of the premium lesson. Unlock
Explanation
Scalar data type characteristics

Scalar data type-ன் முக்கிய properties: Single value store செய்கிறது Usually indivisible / atomic value ஆக co……

Premium This card is part of the premium lesson. Unlock

INTEGER TYPE

Definition

Integer data type என்பது fractional part இல்லாத who……

Premium This card is part of the premium lesson. Unlock
Explanation

25 என்பது ஒரு single numeric value. இதனால் int scalar type. int ↓ one integer va……

Premium This card is part of the premium lesson. Unlock

FLOATING-POINT TYPE

Definition

Decimal / fractional values represent செய்ய floating-point data types பயன்படு……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

double pi = 3.1415926535; இங்……

Premium This card is part of the premium lesson. Unlock

CHARACTER TYPE

Definition

Single character store செய்ய character type பயன்படுக……

Premium This card is part of the premium lesson. Unlock
Important

char ch = 'A'; Single quotes: 'A' ஒரு chara……

Premium This card is part of the premium lesson. Unlock

BOOLEAN TYPE

Definition

Boolean type இரண்டு logical v……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

bool passed = true; passed ஒரு single Boolean value வைத்திருக……

Premium This card is part of the premium lesson. Unlock

ENUMERATION TYPE

Definition

Enumeration என்பது programmer……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

enum Day { Monday, Tuesday, Wednesday }; Variable: Day today = Monday; today ஒரு நேரத்தில் ஒரு enumera……

Premium This card is part of the premium lesson. Unlock

POINTER TYPE

Explanation

சில programming language classifications-ல் pointer-ஐ scalar type என்று classify செய்கிறார்கள். C++ standard ……

Premium This card is part of the premium lesson. Unlock
Explanation

return 0; }…

Premium This card is part of the premium lesson. Unlock

C++ cout பொதுவாக true-ஐ 1 என்றும் false-……

Premium This card is part of the premium lesson. Unlock
Explanation

int age = 25; age ஒரு integer scalar variable. float mark = 85.5f; mark ஒரு floating-p……

Premium This card is part of the premium lesson. Unlock
Dry Run

age ↓ 25 mark ↓ 85.5 grade ↓ A passed ↓ t……

Premium This card is part of the premium lesson. Unlock

1. COMPOSITE DATA TYPES

Definition

Composite data type என்பது multiple data elements / components-ஐ combine ……

Premium This card is part of the premium lesson. Unlock
Real Life Example
Example

int marks[5] = {80, 85, 90, 75, 95}; marks object: marks ……

Premium This card is part of the premium lesson. Unlock
Explanation
Composite data type characteristics

Multiple elements வைத்திருக்கலாம் Elements same type அல்லது different type ஆக இருக்கலாம் Complex data structu……

Premium This card is part of the premium lesson. Unlock

ARRAY

Definition

Array என்பது same type values பலவற்றை co……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int marks[5] = {70, 80, 90, 85, 75}; Representation marks……

Premium This card is part of the premium lesson. Unlock

STRUCTURE

Definition

Structure என்பது different data types ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

struct Student { int rollno; char grade; float mark; }; Object: Student s1; Values: s1.rollno = 101; s1.grade……

Premium This card is part of the premium lesson. Unlock

UNION

Definition

Union structure போலவே multiple members define……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

union Data { int i; float f; char ch; }; Simple Concept Structure: i → separate memory f → separate memory ch……

Premium This card is part of the premium lesson. Unlock

CLASS

Definition

Class என்பது data members மற்றும் member fu……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

Object: Student s; Representation Student object | +--……

Premium This card is part of the premium lesson. Unlock

RECORD

Explanation

Record என்பது Pascal, database theory, programming language theory போன்ற contexts-ல் அதிகம் பயன்படுத்தப்படும்……

Premium This card is part of the premium lesson. Unlock

TUPLE

Explanation

Python போன்ற languages-ல் tuple ஒரு composite collection. ……

Premium This card is part of the premium lesson. Unlock

STRING

Explanation

String classification language-dependent. Conceptually string என்பது: Sequence of characters string name = "P……

Premium This card is part of the premium lesson. Unlock
Definition

All elements same type இருந்த……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int a[4] = {10, 20, 30, 40}; All elements: int……

Premium This card is part of the premium lesson. Unlock
Definition

Different types கொண்ட element……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

struct Student { int roll; char grade; floa……

Premium This card is part of the premium lesson. Unlock
Flow

Composite | +----------------------------+ | | Homogeneous Hete……

Premium This card is part of the premium lesson. Unlock
Explanation
EXAMPLE 1

int x = 10; Analysis: x ↓ 10 One value. Therefore: Scalar int x[3] = {10, 20, 30}; Analysis: x | +--- 10 +---……

Premium This card is part of the premium lesson. Unlock
Explanation
Memory view

Scalar: int x = 10; Conceptual memory: Address Object Value 1000 x 10 ஒரே value. Composit……

Premium This card is part of the premium lesson. Unlock
Explanation
Scalar operation

int a = 10; int b = 20; int c……

Premium This card is part of the premium lesson. Unlock
Explanation
Composite operation

Array: int a[3] = {10, 20, 30}; Usually……

Premium This card is part of the premium lesson. Unlock
Output
Result
Concept
Important concept

Scalar என்றால்: One variable = one logical ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 1

"Array is scalar." Wrong. Arra……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 2

"Structure contains only same type." Wr……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 3

"Character and string are same." Wrong. char ↓ sin……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 4

"Composite means only array." Wrong. Composite inc……

Premium This card is part of the premium lesson. Unlock
Common Mistake

[COMPARISON: SCALAR vs ARRAY] int x = 10; Sca……

Premium This card is part of the premium lesson. Unlock
Memory Trick

Scalar நினைவில் வைக்க: S = Single Scalar ↓ Single Compos……

Premium This card is part of the premium lesson. Unlock
Important

TRB / NET / SET exams-க்கு முக்கியமான points: Scalar type represents one value. Composite type contains multi……

Premium This card is part of the premium lesson. Unlock
MCQ

Which of the following is a s……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is a homogeneous compos……

Premium This card is part of the premium lesson. Unlock
MCQ

Which composite type can cont……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question

What is the basic difference between scalar and composite data types? Answer: Scala……

Premium This card is part of the premium lesson. Unlock
MCQ

Scalar data type represents:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which is a scalar type?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which is a composite type?…

Premium This card is part of the premium lesson. Unlock
MCQ

Array is generally:…

Premium This card is part of the premium lesson. Unlock
MCQ

A structure is generally:…

Premium This card is part of the premium lesson. Unlock
MCQ

Boolean stores:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which can combine int, char, ……

Premium This card is part of the premium lesson. Unlock
MCQ

In C++, pointer type is class……

Premium This card is part of the premium lesson. Unlock
MCQ

Which one is an example of a ……

Premium This card is part of the premium lesson. Unlock
MCQ

Which statement is correct?…

Premium This card is part of the premium lesson. Unlock
Practice

Identify scalar or composite. 1. int age = 25; Answer: Scalar 2. float salary = 25000.50; Answer: Scalar 3. c……

Premium This card is part of the premium lesson. Unlock
Summary

DATA TYPES | +--- SCALAR | | | +--- Integer | +--- Floating Point | +--- Character | +--- Boolean | +--- Enum……

Premium This card is part of the premium lesson. Unlock
Explanation
Short description

Scalar Data Type என்பது ஒரு individual value-ஐ represent செய்கிறது; int, float, char, bool போன்றவை examples. ……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program