SlideShare uma empresa Scribd logo
1 de 4
Slide 1 of 4Ver. 1.0
Programming in C
In this session, you will do the practice questions of Chapter
1 and Chapter 2.
Objectives
Slide 2 of 4Ver. 1.0
Programming in C
Chapter 1
1. Write a function to accept a character and display it 40
times.
2. Write a function that accepts a number from 0 to 9, along
with a string. The string should then be displayed the
number of times specified.
Slide 3 of 4Ver. 1.0
Programming in C
Chapter 2
1. Write a for loop, which will produce the following output
(Hint: use two nested for loops):
1
22
333
4444
55555
2. Create a C program, which calculates the triangular number
of the user’s request, read from the keyboard using scanf().
A triangular number is the sum of the preceding numbers,
so the triangular number 7 has the value of
7+6+5+4+3+2+1 (same as a factorial in mathematics, for
example, factorial of 7 ---- !7).
Slide 4 of 4Ver. 1.0
Programming in C
Chapter 2
3. Create a C program to check whether the number entered
by user is even or odd.

Mais conteúdo relacionado

Mais procurados

Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
alish sha
 
OP 3014 Assignment 02 Please read about the Fibonacci numbers at http:...
OP 3014  Assignment 02  Please read about the Fibonacci numbers at      http:...OP 3014  Assignment 02  Please read about the Fibonacci numbers at      http:...
OP 3014 Assignment 02 Please read about the Fibonacci numbers at http:...
hwbloom39
 
Epc assignment
Epc assignmentEpc assignment
Epc assignment
Hồ Lợi
 

Mais procurados (19)

Assignment java workshop
Assignment java workshopAssignment java workshop
Assignment java workshop
 
Visual Basic Source Codes for Class 11 HSc Paper 1 Practicals
Visual Basic Source Codes for Class 11 HSc Paper 1 PracticalsVisual Basic Source Codes for Class 11 HSc Paper 1 Practicals
Visual Basic Source Codes for Class 11 HSc Paper 1 Practicals
 
Lecture 1: basic syntax
Lecture 1: basic syntaxLecture 1: basic syntax
Lecture 1: basic syntax
 
Fibonacci Series Program in C++
Fibonacci Series Program in C++Fibonacci Series Program in C++
Fibonacci Series Program in C++
 
Mcs 011 ignou question paper c language
Mcs 011 ignou question paper c languageMcs 011 ignou question paper c language
Mcs 011 ignou question paper c language
 
Fibonacci series c++
Fibonacci series c++Fibonacci series c++
Fibonacci series c++
 
Devry cis 115 final exam 3
Devry cis 115 final exam 3Devry cis 115 final exam 3
Devry cis 115 final exam 3
 
Devry cis 115 final exam 3
Devry cis 115 final exam 3Devry cis 115 final exam 3
Devry cis 115 final exam 3
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
 
Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018
 
Pa1 loops
Pa1 loopsPa1 loops
Pa1 loops
 
HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12
 
Mean square error
Mean square errorMean square error
Mean square error
 
OP 3014 Assignment 02 Please read about the Fibonacci numbers at http:...
OP 3014  Assignment 02  Please read about the Fibonacci numbers at      http:...OP 3014  Assignment 02  Please read about the Fibonacci numbers at      http:...
OP 3014 Assignment 02 Please read about the Fibonacci numbers at http:...
 
4.129 tybsc it
4.129 tybsc it4.129 tybsc it
4.129 tybsc it
 
Exp 1
Exp 1Exp 1
Exp 1
 
Epc assignment
Epc assignmentEpc assignment
Epc assignment
 
AER494 Course: Project No.1
AER494 Course: Project No.1AER494 Course: Project No.1
AER494 Course: Project No.1
 
Your first neural network model
Your first neural network modelYour first neural network model
Your first neural network model
 

Destaque

C programming session 16
C programming session 16C programming session 16
C programming session 16
Vivek Singh
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
Vivek Singh
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
Vivek Singh
 
C programming session 10
C programming session 10C programming session 10
C programming session 10
Vivek Singh
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
Vivek Singh
 
Sql create table statement
Sql create table statementSql create table statement
Sql create table statement
Vivek Singh
 

Destaque (6)

C programming session 16
C programming session 16C programming session 16
C programming session 16
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
C programming session 10
C programming session 10C programming session 10
C programming session 10
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
Sql create table statement
Sql create table statementSql create table statement
Sql create table statement
 

Semelhante a C programming session 04

C programming session 04
C programming session 04C programming session 04
C programming session 04
AjayBahoriya
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
Vivek Singh
 
Bti1022 lab sheet 5
Bti1022 lab sheet 5Bti1022 lab sheet 5
Bti1022 lab sheet 5
alish sha
 
Dti2143 lab sheet 4
Dti2143 lab sheet 4Dti2143 lab sheet 4
Dti2143 lab sheet 4
alish sha
 
21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?
sukeshsuresh189
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)
sukeshsuresh189
 
6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...
sukeshsuresh189
 
202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.
sukeshsuresh189
 

Semelhante a C programming session 04 (20)

C programming session 04
C programming session 04C programming session 04
C programming session 04
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
Cse cpl manual-2016
Cse cpl manual-2016Cse cpl manual-2016
Cse cpl manual-2016
 
COLLEGE OF COMPUTING AND INFORMATICS Assignment – 4
COLLEGE OF COMPUTING AND INFORMATICS Assignment – 4COLLEGE OF COMPUTING AND INFORMATICS Assignment – 4
COLLEGE OF COMPUTING AND INFORMATICS Assignment – 4
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
 
Seminar 2 coding_principles
Seminar 2 coding_principlesSeminar 2 coding_principles
Seminar 2 coding_principles
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
Python Manuel-R2021.pdf
Python Manuel-R2021.pdfPython Manuel-R2021.pdf
Python Manuel-R2021.pdf
 
cscript_controller.pdf
cscript_controller.pdfcscript_controller.pdf
cscript_controller.pdf
 
Bti1022 lab sheet 5
Bti1022 lab sheet 5Bti1022 lab sheet 5
Bti1022 lab sheet 5
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
Bsc math previous exam quetions
Bsc math previous exam quetionsBsc math previous exam quetions
Bsc math previous exam quetions
 
A01
A01A01
A01
 
Dti2143 lab sheet 4
Dti2143 lab sheet 4Dti2143 lab sheet 4
Dti2143 lab sheet 4
 
21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)
 
6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...
 
202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.
 

Mais de Vivek Singh

C programming session 14
C programming session 14C programming session 14
C programming session 14
Vivek Singh
 
C programming session 13
C programming session 13C programming session 13
C programming session 13
Vivek Singh
 
C programming session 11
C programming session 11C programming session 11
C programming session 11
Vivek Singh
 
C programming session 07
C programming session 07C programming session 07
C programming session 07
Vivek Singh
 
Niit aptitude question paper
Niit aptitude question paperNiit aptitude question paper
Niit aptitude question paper
Vivek Singh
 
Excel shortcut and tips
Excel shortcut and tipsExcel shortcut and tips
Excel shortcut and tips
Vivek Singh
 
Sql where clause
Sql where clauseSql where clause
Sql where clause
Vivek Singh
 
Sql update statement
Sql update statementSql update statement
Sql update statement
Vivek Singh
 
Sql tutorial, tutorials sql
Sql tutorial, tutorials sqlSql tutorial, tutorials sql
Sql tutorial, tutorials sql
Vivek Singh
 
Sql select statement
Sql select statementSql select statement
Sql select statement
Vivek Singh
 
Sql query tuning or query optimization
Sql query tuning or query optimizationSql query tuning or query optimization
Sql query tuning or query optimization
Vivek Singh
 
Sql query tips or query optimization
Sql query tips or query optimizationSql query tips or query optimization
Sql query tips or query optimization
Vivek Singh
 
Sql order by clause
Sql order by clauseSql order by clause
Sql order by clause
Vivek Singh
 
Sql operators comparision & logical operators
Sql operators   comparision & logical operatorsSql operators   comparision & logical operators
Sql operators comparision & logical operators
Vivek Singh
 
Sql logical operators
Sql logical operatorsSql logical operators
Sql logical operators
Vivek Singh
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
Vivek Singh
 
Sql insert statement
Sql insert statementSql insert statement
Sql insert statement
Vivek Singh
 

Mais de Vivek Singh (20)

C programming session 14
C programming session 14C programming session 14
C programming session 14
 
C programming session 13
C programming session 13C programming session 13
C programming session 13
 
C programming session 11
C programming session 11C programming session 11
C programming session 11
 
C programming session 07
C programming session 07C programming session 07
C programming session 07
 
Niit aptitude question paper
Niit aptitude question paperNiit aptitude question paper
Niit aptitude question paper
 
Excel shortcut and tips
Excel shortcut and tipsExcel shortcut and tips
Excel shortcut and tips
 
Sql where clause
Sql where clauseSql where clause
Sql where clause
 
Sql update statement
Sql update statementSql update statement
Sql update statement
 
Sql tutorial, tutorials sql
Sql tutorial, tutorials sqlSql tutorial, tutorials sql
Sql tutorial, tutorials sql
 
Sql subquery
Sql subquerySql subquery
Sql subquery
 
Sql select statement
Sql select statementSql select statement
Sql select statement
 
Sql rename
Sql renameSql rename
Sql rename
 
Sql query tuning or query optimization
Sql query tuning or query optimizationSql query tuning or query optimization
Sql query tuning or query optimization
 
Sql query tips or query optimization
Sql query tips or query optimizationSql query tips or query optimization
Sql query tips or query optimization
 
Sql order by clause
Sql order by clauseSql order by clause
Sql order by clause
 
Sql operators comparision & logical operators
Sql operators   comparision & logical operatorsSql operators   comparision & logical operators
Sql operators comparision & logical operators
 
Sql logical operators
Sql logical operatorsSql logical operators
Sql logical operators
 
Sql joins
Sql joinsSql joins
Sql joins
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
 
Sql insert statement
Sql insert statementSql insert statement
Sql insert statement
 

Último

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Último (20)

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

C programming session 04

  • 1. Slide 1 of 4Ver. 1.0 Programming in C In this session, you will do the practice questions of Chapter 1 and Chapter 2. Objectives
  • 2. Slide 2 of 4Ver. 1.0 Programming in C Chapter 1 1. Write a function to accept a character and display it 40 times. 2. Write a function that accepts a number from 0 to 9, along with a string. The string should then be displayed the number of times specified.
  • 3. Slide 3 of 4Ver. 1.0 Programming in C Chapter 2 1. Write a for loop, which will produce the following output (Hint: use two nested for loops): 1 22 333 4444 55555 2. Create a C program, which calculates the triangular number of the user’s request, read from the keyboard using scanf(). A triangular number is the sum of the preceding numbers, so the triangular number 7 has the value of 7+6+5+4+3+2+1 (same as a factorial in mathematics, for example, factorial of 7 ---- !7).
  • 4. Slide 4 of 4Ver. 1.0 Programming in C Chapter 2 3. Create a C program to check whether the number entered by user is even or odd.

Notas do Editor

  1. Begin the session by explaining the objectives of the session.