C programming for problem solving, Exercises of C programming

this pdf has basic questions and answers for c programming...

Typology: Exercises

2021/2022

Uploaded on 10/08/2022

aldrin-jerry
aldrin-jerry 🇮🇳

5

(1)

4 documents

1 / 178

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
21CSS101J Programming for Problem Solving
Unit I
SRM
INSTITUTE OF SCIENCE ANDTECHNOLOGY,
CHENNAI.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download C programming for problem solving and more Exercises C programming in PDF only on Docsity!

21CSS101J – Programming for Problem Solving

Unit I

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Prepared by:

DR.D.SHINY IRENE

ASSITANT PROFESSOR(CTECH)

SRMIST-KTR

INSTITUTE OF SCIENCE AND TECHNOLOGY,

CHENNAI.

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

UNIT I (TOPICS

COVERED)

Evolution of Programming & Languages - Problem Solving

through Programming - Creating Algorithms - Writing

Pseudocode - Evolution of C language, its usage history - Input

and output functions: Printf and scanf - Variables and

identifiers – Expressions - Single line and multiline comments

  • Constants, Keywords - Values, Names, Scope, Binding, Storage

Classes - Numeric Data types: integer -

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

UNIT I (TOPICS

COVERED)

floating point - Non-Numeric Data types: char and string -

Increment and decrement operator - Comma, Arrow and

Assignment operator - Bitwise and Sizeof operator Arithmetic,

Relational and logical Operators, Condition Operator, Operator

Precedence - Expressions with pre / post increment operator

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Evolution of Programming & Languages Contd…

Period Programming Langugaes 1950’s Creation of high-level languages 1960’s Forth. Simula I. Lisp, Cobol 1970’s Pascal, C language 1980’s ML. Smalltalk, C++ 1990’s Java, Perl, Python languages 2000 Internet Programming 2010 Concurrency and asynchronicity. JavaScript and Go language

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Problem Solving through Programming Contd…

i. Creative Thinking
 Proven method for approaching a challenge or opportunity in

an imaginative way

 Process for innovation that helps explore and reframe the

problems faced, come up with new, innovative responses and solutions and then take action

 It is generative, nonjudgmental and expansive
 Thinking creatively, a lists of new ideas are generated

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Problem Solving through Programming Contd…

ii. Critical Thinking
 Engages a diverse range of intellectual skills and activities that

are concerned with evaluating information, our assumptions and our thinking processes in a disciplined way so that we can think and assess information more comprehensively

 It is Analytical, Judgmental and Selective
 Thinking critically allows a programmer in making choices

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Problem Solving through Programming Contd…

 Program - Set of instructions that instructs the computer to do a

task

 Programming Process
a) Defining the Problem
b) Planning the Solution
c) Coding the Program
d) Testing the Program
e) Documenting the Program

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Problem Solving through Programming Contd…

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Problem Solving through Programming Contd…

b) Refine the algorithm successively to get step by step detailed

algorithm that is very close to a computer language

c) Pseudocode is an artificial and informal language that helps

programmers develop algorithms

 Pseudocode is very similar to everyday English

Algorithm: a step-by-step method for solving a

problem or doing a task.

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Creating Algorithms

 An informal definition of an algorithm is:

i

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Creating Algorithms

 Notations
 Starting point
 Step Numbers – Positions in Algorithm
Incoming Information - Input
 Control Flow – Order of evaluating Instructions
 Statements
 Outgoing Information - Output
 Ending Point

INSTITUTE OF SCIENCE ANDTECHNOLOGY,

CHENNAI.

Creating Algorithms Contd…

 Properties of an algorithm
 Finite : The algorithm must eventually terminate
 Complete : Always give a solution when one exists
 Correct (sound) : Always give a correct solution
 Rules of Writing an Algorithm
 Be consistent
 Have well Defined input and output
 Do not use any syntax of any specific programming language