0% found this document useful (0 votes)
15 views20 pages

Basic Concepts of Programming - Withlogo

The document provides an overview of basic programming concepts, including variables, conditional statements, looping and iteration, data types, and functions. It explains the significance of variables as symbolic names for information, the use of conditional statements to execute actions based on true or false conditions, and the role of loops in repeating processes. Additionally, it covers data types that classify variable information and the structure of functions for executing specific tasks.

Uploaded by

ndumisomtsweni6
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)
15 views20 pages

Basic Concepts of Programming - Withlogo

The document provides an overview of basic programming concepts, including variables, conditional statements, looping and iteration, data types, and functions. It explains the significance of variables as symbolic names for information, the use of conditional statements to execute actions based on true or false conditions, and the role of loops in repeating processes. Additionally, it covers data types that classify variable information and the structure of functions for executing specific tasks.

Uploaded by

ndumisomtsweni6
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

Basic Concepts of

Programming
ndumisomtsweni6@[Link]
S3BQCE8T9Z

Ritwik Raj
Great Learning

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Variable
ndumisomtsweni6@[Link]
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Variable
It is a symbolic name or reference to some kind of information.

A variable is a virtual container whose value can


change over a period of time.
ndumisomtsweni6@[Link]
S3BQCE8T9Z

int roll = 10; // roll is a variable

roll 10
RAM
This file is meant for personal use by ndumisomtsweni6@[Link] only.
Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Programming language Code

Python

Java

ndumisomtsweni6@[Link]
S3BQCE8T9Z C++

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Conditional
ndumisomtsweni6@[Link]

Statements
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Conditional Statements
These are expressions that ask the program to determine if a variable is true or false

There are two possible ways:


ndumisomtsweni6@[Link]
S3BQCE8T9Z
1. True – Action1

2. False – Action2

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Programming language Code

Python

ndumisomtsweni6@[Link]
S3BQCE8T9Z

Java

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Programming language Code

C++

ndumisomtsweni6@[Link]
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
ndumisomtsweni6@[Link]

Looping and Iteration


S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Looping and Iteration
Iteration is any time a program repeats a process or sequence.

Loops are a common type of iterations


ndumisomtsweni6@[Link]
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Programming language Code

Python

Java

ndumisomtsweni6@[Link]
S3BQCE8T9Z
C++

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Datatypes
ndumisomtsweni6@[Link]
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Datatypes
Data types help classify what information a variable can hold and what can be
done with it.

Numbers
ndumisomtsweni6@[Link]
S3BQCE8T9Z
Decimal
Booleans
Characters
Strings

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Programming language Code

Python

ndumisomtsweni6@[Link]
S3BQCE8T9Z

Java

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Programming language Code

C++

ndumisomtsweni6@[Link]
S3BQCE8T9Z C

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Functions
ndumisomtsweni6@[Link]
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Functions
These are self contained modules of code that accomplish a particular task.
Methods with no return type :
public void add(int num1, int num2){
int sum = num1 + num2;
ndumisomtsweni6@[Link]
S3BQCE8T9Z [Link](“Sum of two numbers are : ”+sum);
}

Methods with return type :


public int add(int num1, int num2){
int sum = num1 + num2;
return sum;
}

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Programming language Code

Python

Java
ndumisomtsweni6@[Link]
S3BQCE8T9Z

C++

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Sharing or publishing the contents in part or full is liable for legal action.
Have a Great Learning
ndumisomtsweni6@[Link]
S3BQCE8T9Z

All the Best !!

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]
Thank You!
ndumisomtsweni6@[Link]
S3BQCE8T9Z

This file is meant for personal use by ndumisomtsweni6@[Link] only.


Proprietary content.
Sharing ©Great Learning.
or publishing All Rights in
the contents Reserved.
part or Unauthorized
full is liableuse
for or distribution
legal [Link]

You might also like