SlideShare a Scribd company logo
User Input & Basic Programs
Md. Alamgir Hossain
Lecturer,
Dept. of CSE, Prime University
Mail: alamgir.cse14.just@gmail.com
User Input-scanf() function
The scanf() function is used for input. It reads the input data from the console.
scanf("format string", argument_list);
Example:
1. scanf(“%d”, &n); If int n;
2. scanf(“%f”, &x); If float x;
Program for Addition of Two numbers
Program for Addition of Two numbers
Program for Addition of Two numbers
Program for Addition of Two numbers
Program for Addition of Two numbers
Program for Addition of Two numbers
Addition & Subtraction of Two numbers
Addition & Subtraction of Two numbers
Homework-01
01. Write a C program that can take 2 float values from user and perform
addition, subtraction, multiplication and division.
Area of a Triangle
h
b
Area A = .5 * h * b
Area of a Triangle in C
Homework-02 & 03
02. Write a C program to find the area of a circle.
03. Write a C program to find the area of a square.
Thank You

More Related Content

What's hot (20)

PPTX
Basic Input and Output
Nurul Zakiah Zamri Tan
 
PPTX
Introduction to C programming
Sabik T S
 
PPTX
Data Input and Output
Sabik T S
 
PDF
CP Handout#9
trupti1976
 
PDF
CP Handout#10
trupti1976
 
DOCX
Ankita sharma focp
AnkitaSharma463389
 
PDF
Chapter 3 - Variable Memory Concept
Deepak Singh
 
PPTX
Input output statement in C
Muthuganesh S
 
PDF
CP Handout#6
trupti1976
 
PDF
7. input and output functions
Way2itech
 
PDF
First c program
Komal Pardeshi
 
PPT
Operators in C Programming
programming9
 
PPTX
Input Output Management In C Programming
Kamal Acharya
 
PDF
CP Handout#5
trupti1976
 
PPTX
C programming(Part 1)
Dr. SURBHI SAROHA
 
PPTX
Managing input and output operations in c
niyamathShariff
 
PDF
C- Programming Assignment 3
Animesh Chaturvedi
 
PPSX
Concepts of C [Module 2]
Abhishek Sinha
 
PPTX
Write a program that accepts percentage from the user and displays its grade ...
Farwa Aqeel
 
PPTX
Programming in C (part 2)
Dr. SURBHI SAROHA
 
Basic Input and Output
Nurul Zakiah Zamri Tan
 
Introduction to C programming
Sabik T S
 
Data Input and Output
Sabik T S
 
CP Handout#9
trupti1976
 
CP Handout#10
trupti1976
 
Ankita sharma focp
AnkitaSharma463389
 
Chapter 3 - Variable Memory Concept
Deepak Singh
 
Input output statement in C
Muthuganesh S
 
CP Handout#6
trupti1976
 
7. input and output functions
Way2itech
 
First c program
Komal Pardeshi
 
Operators in C Programming
programming9
 
Input Output Management In C Programming
Kamal Acharya
 
CP Handout#5
trupti1976
 
C programming(Part 1)
Dr. SURBHI SAROHA
 
Managing input and output operations in c
niyamathShariff
 
C- Programming Assignment 3
Animesh Chaturvedi
 
Concepts of C [Module 2]
Abhishek Sinha
 
Write a program that accepts percentage from the user and displays its grade ...
Farwa Aqeel
 
Programming in C (part 2)
Dr. SURBHI SAROHA
 

Similar to 3. user input and some basic problem (20)

PPTX
C coding#1
Sekhar Pisini
 
PDF
Arithmetic operator
Md Masudur Rahman
 
PPTX
CSE-1204-Lab-02-Variables and Data Types.pptx
MARaihanEmon
 
DOCX
Important C program of Balagurusamy Book
Abir Hossain
 
PDF
Subject:Programming in C - Lab Programmes
vasukir11
 
PPTX
C Language ppt create by Anand & Sager.pptx
kumaranand07297
 
PPTX
Presentation on Function in C Programming
Shuvongkor Barman
 
PDF
Ada lab manual
aman713418
 
PDF
Computer P-Lab-Manual acc to syllabus.pdf
sujathachoudaryn29
 
DOCX
Report on Flutter.docx prasentation for study
HetalVasava9
 
PPTX
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
G. H. Raisoni Academy of Engineering & Technology, Nagpur
 
DOCX
Programming in c
Ashutosh Srivasatava
 
PDF
C programming
Shahariar limon
 
DOC
Datastructure notes
Srikanth
 
DOC
Xi practical file
dipanshupatidar3
 
PDF
Cp manual final
itprasad1237
 
DOCX
Muzzammilrashid
muzzammilrashid
 
PPTX
C functions by ranjan call by value and reference.pptx
ranjan317165
 
PDF
C programs
Vikram Nandini
 
PDF
Unit 2
DURGADEVIP
 
C coding#1
Sekhar Pisini
 
Arithmetic operator
Md Masudur Rahman
 
CSE-1204-Lab-02-Variables and Data Types.pptx
MARaihanEmon
 
Important C program of Balagurusamy Book
Abir Hossain
 
Subject:Programming in C - Lab Programmes
vasukir11
 
C Language ppt create by Anand & Sager.pptx
kumaranand07297
 
Presentation on Function in C Programming
Shuvongkor Barman
 
Ada lab manual
aman713418
 
Computer P-Lab-Manual acc to syllabus.pdf
sujathachoudaryn29
 
Report on Flutter.docx prasentation for study
HetalVasava9
 
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
G. H. Raisoni Academy of Engineering & Technology, Nagpur
 
Programming in c
Ashutosh Srivasatava
 
C programming
Shahariar limon
 
Datastructure notes
Srikanth
 
Xi practical file
dipanshupatidar3
 
Cp manual final
itprasad1237
 
Muzzammilrashid
muzzammilrashid
 
C functions by ranjan call by value and reference.pptx
ranjan317165
 
C programs
Vikram Nandini
 
Unit 2
DURGADEVIP
 
Ad

More from Alamgir Hossain (12)

PPTX
How to write a project proposal for software engineering course
Alamgir Hossain
 
PPTX
Malware Detection Approaches using Data Mining Techniques.pptx
Alamgir Hossain
 
PPTX
5 nested if in c with proper example
Alamgir Hossain
 
PPTX
4. decision making and some basic problem
Alamgir Hossain
 
PPTX
1. importance of c
Alamgir Hossain
 
PDF
Computer graphics lab report with code in cpp
Alamgir Hossain
 
PDF
Report on student-faculty document sharing android project
Alamgir Hossain
 
PDF
A lab report on modeling and simulation with python code
Alamgir Hossain
 
PDF
Lab report on to plot efficiency of pure and slotted aloha in matlab a data c...
Alamgir Hossain
 
PDF
Lab report for Prolog program in artificial intelligence.
Alamgir Hossain
 
PDF
Digital signal Processing all matlab code with Lab report
Alamgir Hossain
 
PPTX
Microsoft Teams
Alamgir Hossain
 
How to write a project proposal for software engineering course
Alamgir Hossain
 
Malware Detection Approaches using Data Mining Techniques.pptx
Alamgir Hossain
 
5 nested if in c with proper example
Alamgir Hossain
 
4. decision making and some basic problem
Alamgir Hossain
 
1. importance of c
Alamgir Hossain
 
Computer graphics lab report with code in cpp
Alamgir Hossain
 
Report on student-faculty document sharing android project
Alamgir Hossain
 
A lab report on modeling and simulation with python code
Alamgir Hossain
 
Lab report on to plot efficiency of pure and slotted aloha in matlab a data c...
Alamgir Hossain
 
Lab report for Prolog program in artificial intelligence.
Alamgir Hossain
 
Digital signal Processing all matlab code with Lab report
Alamgir Hossain
 
Microsoft Teams
Alamgir Hossain
 
Ad

Recently uploaded (20)

PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Dimensions of Societal Planning in Commonism
StefanMz
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 

3. user input and some basic problem