SlideShare a Scribd company logo
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.

More Related Content

What's hot (19)

DOCX
Assignment java workshop
Jaya Jeswani
 
PDF
Visual Basic Source Codes for Class 11 HSc Paper 1 Practicals
Aditi Bhushan
 
PPTX
Lecture 1: basic syntax
Vivek Bhargav
 
PDF
Fibonacci Series Program in C++
Hitesh Kumar
 
PDF
Mcs 011 ignou question paper c language
wolverine x-man
 
PDF
Fibonacci series c++
Hitesh Kumar
 
DOC
Devry cis 115 final exam 3
shamek1236
 
DOC
Devry cis 115 final exam 3
eyavagal
 
DOCX
Dti2143 lab sheet 9
alish sha
 
PPTX
Introduction to computer_lec_04_fall_2018
Ramadan Babers, PhD
 
PPTX
Pa1 loops
aiclub_slides
 
DOCX
HSc Computer Science Practical Slip for Class 12
Aditi Bhushan
 
PDF
Mean square error
Jay Patel
 
PDF
OP 3014 Assignment 02 Please read about the Fibonacci numbers at http:...
hwbloom39
 
PDF
4.129 tybsc it
Aziz Chikhly
 
PPTX
Exp 1
Mitu Bhowmick
 
PDF
Epc assignment
Hồ Lợi
 
PDF
AER494 Course: Project No.1
mohamedrabie90
 
PPTX
Your first neural network model
Atmaram Naik
 
Assignment java workshop
Jaya Jeswani
 
Visual Basic Source Codes for Class 11 HSc Paper 1 Practicals
Aditi Bhushan
 
Lecture 1: basic syntax
Vivek Bhargav
 
Fibonacci Series Program in C++
Hitesh Kumar
 
Mcs 011 ignou question paper c language
wolverine x-man
 
Fibonacci series c++
Hitesh Kumar
 
Devry cis 115 final exam 3
shamek1236
 
Devry cis 115 final exam 3
eyavagal
 
Dti2143 lab sheet 9
alish sha
 
Introduction to computer_lec_04_fall_2018
Ramadan Babers, PhD
 
Pa1 loops
aiclub_slides
 
HSc Computer Science Practical Slip for Class 12
Aditi Bhushan
 
Mean square error
Jay Patel
 
OP 3014 Assignment 02 Please read about the Fibonacci numbers at http:...
hwbloom39
 
4.129 tybsc it
Aziz Chikhly
 
Epc assignment
Hồ Lợi
 
AER494 Course: Project No.1
mohamedrabie90
 
Your first neural network model
Atmaram Naik
 

Viewers also liked (6)

PPS
C programming session 16
Vivek Singh
 
PPS
C programming session 02
Vivek Singh
 
PPS
C programming session 01
Vivek Singh
 
PPS
C programming session 10
Vivek Singh
 
PPS
C programming session 05
Vivek Singh
 
PDF
Sql create table statement
Vivek Singh
 
C programming session 16
Vivek Singh
 
C programming session 02
Vivek Singh
 
C programming session 01
Vivek Singh
 
C programming session 10
Vivek Singh
 
C programming session 05
Vivek Singh
 
Sql create table statement
Vivek Singh
 
Ad

Similar to C programming session 04 (20)

PPS
C programming session 04
AjayBahoriya
 
PPS
C programming session 08
Vivek Singh
 
PDF
Cp manual final
itprasad1237
 
DOCX
Important C program of Balagurusamy Book
Abir Hossain
 
RTF
Cse cpl manual-2016
Rajendra khatana
 
PDF
COLLEGE OF COMPUTING AND INFORMATICS Assignment – 4
Voffelarin
 
PDF
Pcd201516
sheikhmoidin
 
PDF
(2 - 1) CSE1021 - Module 2 Worksheet.pdf
ayushagar5185
 
PPTX
Seminar 2 coding_principles
moduledesign
 
PDF
csharp repitition structures
Micheal Ogundero
 
PDF
Python Manuel-R2021.pdf
RamprakashSingaravel1
 
PDF
cscript_controller.pdf
VcTrn1
 
DOCX
Bti1022 lab sheet 5
alish sha
 
PPTX
lecture 2.2.2 2D array.pptx IUGLFHLHFJFY
gargh4711
 
PDF
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
ANJALAI AMMAL MAHALINGAM ENGINEERING COLLEGE
 
PPTX
Bsc math previous exam quetions
mshoaib15
 
PDF
A01
lksoo
 
DOCX
Dti2143 lab sheet 4
alish sha
 
DOC
5: Every Java application is required to have
sukeshsuresh189
 
DOC
15: Which method call converts the value in variable stringVariable to an int...
sukeshsuresh189
 
C programming session 04
AjayBahoriya
 
C programming session 08
Vivek Singh
 
Cp manual final
itprasad1237
 
Important C program of Balagurusamy Book
Abir Hossain
 
Cse cpl manual-2016
Rajendra khatana
 
COLLEGE OF COMPUTING AND INFORMATICS Assignment – 4
Voffelarin
 
Pcd201516
sheikhmoidin
 
(2 - 1) CSE1021 - Module 2 Worksheet.pdf
ayushagar5185
 
Seminar 2 coding_principles
moduledesign
 
csharp repitition structures
Micheal Ogundero
 
Python Manuel-R2021.pdf
RamprakashSingaravel1
 
cscript_controller.pdf
VcTrn1
 
Bti1022 lab sheet 5
alish sha
 
lecture 2.2.2 2D array.pptx IUGLFHLHFJFY
gargh4711
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
ANJALAI AMMAL MAHALINGAM ENGINEERING COLLEGE
 
Bsc math previous exam quetions
mshoaib15
 
A01
lksoo
 
Dti2143 lab sheet 4
alish sha
 
5: Every Java application is required to have
sukeshsuresh189
 
15: Which method call converts the value in variable stringVariable to an int...
sukeshsuresh189
 
Ad

More from Vivek Singh (20)

PPS
C programming session 14
Vivek Singh
 
PPS
C programming session 13
Vivek Singh
 
PPS
C programming session 11
Vivek Singh
 
PPS
C programming session 07
Vivek Singh
 
PDF
Niit aptitude question paper
Vivek Singh
 
PDF
Excel shortcut and tips
Vivek Singh
 
PDF
Sql where clause
Vivek Singh
 
PDF
Sql update statement
Vivek Singh
 
PDF
Sql tutorial, tutorials sql
Vivek Singh
 
PDF
Sql subquery
Vivek Singh
 
PDF
Sql select statement
Vivek Singh
 
PDF
Sql rename
Vivek Singh
 
PDF
Sql query tuning or query optimization
Vivek Singh
 
PDF
Sql query tips or query optimization
Vivek Singh
 
PDF
Sql order by clause
Vivek Singh
 
PDF
Sql operators comparision & logical operators
Vivek Singh
 
PDF
Sql logical operators
Vivek Singh
 
PDF
Sql joins
Vivek Singh
 
PDF
Sql integrity constraints
Vivek Singh
 
PDF
Sql insert statement
Vivek Singh
 
C programming session 14
Vivek Singh
 
C programming session 13
Vivek Singh
 
C programming session 11
Vivek Singh
 
C programming session 07
Vivek Singh
 
Niit aptitude question paper
Vivek Singh
 
Excel shortcut and tips
Vivek Singh
 
Sql where clause
Vivek Singh
 
Sql update statement
Vivek Singh
 
Sql tutorial, tutorials sql
Vivek Singh
 
Sql subquery
Vivek Singh
 
Sql select statement
Vivek Singh
 
Sql rename
Vivek Singh
 
Sql query tuning or query optimization
Vivek Singh
 
Sql query tips or query optimization
Vivek Singh
 
Sql order by clause
Vivek Singh
 
Sql operators comparision & logical operators
Vivek Singh
 
Sql logical operators
Vivek Singh
 
Sql joins
Vivek Singh
 
Sql integrity constraints
Vivek Singh
 
Sql insert statement
Vivek Singh
 

Recently uploaded (20)

PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
Dimensions of Societal Planning in Commonism
StefanMz
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
community health nursing question paper 2.pdf
Prince kumar
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 

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.

Editor's Notes

  • #2: Begin the session by explaining the objectives of the session.