SlideShare a Scribd company logo
1 of 7
CSE 1111
Fundamentals of Computer and
Computing Lab
Exp 1 – scanf, printf and variables
Department of Computer Science
and Engineering
University of Dhaka
Instructions
• Solve all the problems using only scanf, printf
and simple arithmetic operations.
• You are not allowed to use any if else, loop or
any other advanced constructs.
• You are not allowed to discuss to each other.
Please ask your teacher about any concerns.
09-May-16 2
Today’s experiments - 1
• s = ut + (at2)/2. Take as input u, a and t.
Calculate s using the formula. Print the value
of s.
09-May-16 3
Today’s experiments - 2
Given an angle (in degree), convert that to radian
and show sin and cos of that angle (up to three
decimal places). (use functions from math.h
header file)
Example:
Enter angle: 60
Radian: 1.04
sin(60) = 0.866
cos(60) = 0.500
09-May-16 4
Today’s experiments - 3
Take a number n as input and show the multiplication table for n.
Example:
Enter n: 7
Multiplication table for 7
******************
7 X 1 = 7
7 X 2 = 14
7 X 3 = 21
7 X 4 = 28
7 X 5 = 35
7 X 6 = 42
7 X 7 = 49
7 X 8 = 56
7 X 9 = 63
7 X 10 = 70
*******************
09-May-16 5
Today’s experiments - 4
Given two time find the absolute difference between them in minutes.
You may assume that times are given in 24 hour format and the first
time is always smaller than the second. That means if the second
time looks smaller, its from the next day (example 2). You cannot
use any if else to solve the problem.
Example 1:
Enter first time: 11 20
Enter second time: 12 40
Difference: 80 minutes
Example 2:
Enter first time: 13 20
Enter second time: 12 40
Difference: 1400 minutes
09-May-16 6
Today’s experiments - 5
Write a program that will take a 6 digit integer number as input and show
each digit of the number in a separate line. Also, print the sum of digits.
Example:
Please enter a 6 digit number:
349701
Digits are:
3
4
9
7
0
1
Sum of digits = 24
09-May-16 7

More Related Content

What's hot

Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...hwbloom49
 
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...Firas Husseini
 
November 2, 2015
November 2, 2015November 2, 2015
November 2, 2015khyps13
 
Epc assignment
Epc assignmentEpc assignment
Epc assignmentHồ Lợi
 
2.3 notes b
2.3 notes b2.3 notes b
2.3 notes bmbetzel
 
Sequence task 4 (past year)
Sequence task 4 (past year)Sequence task 4 (past year)
Sequence task 4 (past year)lilyhwa1
 
March 26
March 26March 26
March 26khyps13
 
February 10, 2014
February 10, 2014February 10, 2014
February 10, 2014khyps13
 
8th alg -l8.3
8th alg -l8.38th alg -l8.3
8th alg -l8.3jdurst65
 
Matrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABMatrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABAbu Raihan Ibna Ali
 
Surds and indices
Surds and indicesSurds and indices
Surds and indicesmajapamaya
 

What's hot (20)

Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
Write a program that produces the first 11 rows of Pascal’s triangle. (Note: ...
 
3 8
3 83 8
3 8
 
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
 
Lecture 3.6 bt
Lecture 3.6 btLecture 3.6 bt
Lecture 3.6 bt
 
A02
A02A02
A02
 
Pa1 flow chart
Pa1 flow chartPa1 flow chart
Pa1 flow chart
 
November 2, 2015
November 2, 2015November 2, 2015
November 2, 2015
 
Epc assignment
Epc assignmentEpc assignment
Epc assignment
 
2.3 notes b
2.3 notes b2.3 notes b
2.3 notes b
 
Sequence task 4 (past year)
Sequence task 4 (past year)Sequence task 4 (past year)
Sequence task 4 (past year)
 
Logical vectors
Logical vectorsLogical vectors
Logical vectors
 
March 26
March 26March 26
March 26
 
February 10, 2014
February 10, 2014February 10, 2014
February 10, 2014
 
8th alg -l8.3
8th alg -l8.38th alg -l8.3
8th alg -l8.3
 
Absolute value
Absolute valueAbsolute value
Absolute value
 
Matrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABMatrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLAB
 
Surds and indices
Surds and indicesSurds and indices
Surds and indices
 
Cs 1114 - lecture-9
Cs 1114 - lecture-9Cs 1114 - lecture-9
Cs 1114 - lecture-9
 
2 2
2 22 2
2 2
 
Absolute value
Absolute valueAbsolute value
Absolute value
 

Viewers also liked (16)

Deb OBrien Awards
Deb OBrien AwardsDeb OBrien Awards
Deb OBrien Awards
 
Tecnologia e imprenditorialità
Tecnologia e imprenditorialitàTecnologia e imprenditorialità
Tecnologia e imprenditorialità
 
Resume_Pranab Kumar Samanta
Resume_Pranab Kumar SamantaResume_Pranab Kumar Samanta
Resume_Pranab Kumar Samanta
 
Sap
SapSap
Sap
 
How to become a 360° engineer
How to become a 360° engineerHow to become a 360° engineer
How to become a 360° engineer
 
Trabajo Final CRM - Maestría en MArketing
Trabajo Final CRM - Maestría en MArketingTrabajo Final CRM - Maestría en MArketing
Trabajo Final CRM - Maestría en MArketing
 
Flour Mills Management System
Flour Mills Management SystemFlour Mills Management System
Flour Mills Management System
 
RMG IN BANGLADESH
RMG IN BANGLADESHRMG IN BANGLADESH
RMG IN BANGLADESH
 
Alex Nielson Visual Media Portfolio
Alex Nielson Visual Media PortfolioAlex Nielson Visual Media Portfolio
Alex Nielson Visual Media Portfolio
 
What is ISICT?
What is ISICT?What is ISICT?
What is ISICT?
 
HISTORIA DEL TELEFONO
HISTORIA DEL TELEFONO HISTORIA DEL TELEFONO
HISTORIA DEL TELEFONO
 
Copiade bitacoraracca
Copiade bitacoraraccaCopiade bitacoraracca
Copiade bitacoraracca
 
Analisi ambientale iniziale Comune di Castelfranco Veneto
Analisi ambientale iniziale Comune di Castelfranco VenetoAnalisi ambientale iniziale Comune di Castelfranco Veneto
Analisi ambientale iniziale Comune di Castelfranco Veneto
 
Didáctica critica
Didáctica critica Didáctica critica
Didáctica critica
 
FABRICATION
FABRICATIONFABRICATION
FABRICATION
 
FarmerGameScreenshots
FarmerGameScreenshotsFarmerGameScreenshots
FarmerGameScreenshots
 

Similar to Exp 1

Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfTulasiramKandula1
 
Pre-Calculus Midterm Exam 1 Score ______ ____.docx
Pre-Calculus Midterm Exam  1  Score ______  ____.docxPre-Calculus Midterm Exam  1  Score ______  ____.docx
Pre-Calculus Midterm Exam 1 Score ______ ____.docxChantellPantoja184
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Gopi Saiteja
 
جلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارتجلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارتHamid Jahangiri
 
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...WILIAMMAURICIOCAHUAT1
 
Assignment 5CSCI 3110 Design and Analysis of Algorithms.docx
Assignment 5CSCI 3110 Design and Analysis of Algorithms.docxAssignment 5CSCI 3110 Design and Analysis of Algorithms.docx
Assignment 5CSCI 3110 Design and Analysis of Algorithms.docxssuser562afc1
 
tutorial5.ppt
tutorial5.ppttutorial5.ppt
tutorial5.pptjvjfvvoa
 
This quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutletThis quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutletBeardmore
 
CS106 Lab 3 - Modulus
CS106 Lab 3 - ModulusCS106 Lab 3 - Modulus
CS106 Lab 3 - ModulusNada Kamel
 
Stanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programmingStanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programmingYu-Sheng (Yosen) Chen
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingNuzhat Memon
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematicalbabuk110
 
Ch-2 final exam documet compler design elements
Ch-2 final exam documet compler design elementsCh-2 final exam documet compler design elements
Ch-2 final exam documet compler design elementsMAHERMOHAMED27
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019Robert Geofroy
 
data structures and algorithms Unit 4
data structures and algorithms Unit 4data structures and algorithms Unit 4
data structures and algorithms Unit 4infanciaj
 

Similar to Exp 1 (20)

Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdf
 
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
 
Pre-Calculus Midterm Exam 1 Score ______ ____.docx
Pre-Calculus Midterm Exam  1  Score ______  ____.docxPre-Calculus Midterm Exam  1  Score ______  ____.docx
Pre-Calculus Midterm Exam 1 Score ______ ____.docx
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2
 
جلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارتجلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارت
 
A01
A01A01
A01
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
 
Assignment 5CSCI 3110 Design and Analysis of Algorithms.docx
Assignment 5CSCI 3110 Design and Analysis of Algorithms.docxAssignment 5CSCI 3110 Design and Analysis of Algorithms.docx
Assignment 5CSCI 3110 Design and Analysis of Algorithms.docx
 
tutorial5.ppt
tutorial5.ppttutorial5.ppt
tutorial5.ppt
 
This quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutletThis quiz is open book and open notes/tutorialoutlet
This quiz is open book and open notes/tutorialoutlet
 
CS106 Lab 3 - Modulus
CS106 Lab 3 - ModulusCS106 Lab 3 - Modulus
CS106 Lab 3 - Modulus
 
refreshENM1500.pdf
refreshENM1500.pdfrefreshENM1500.pdf
refreshENM1500.pdf
 
Stanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programmingStanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programming
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem Solving
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematical
 
Ch-2 final exam documet compler design elements
Ch-2 final exam documet compler design elementsCh-2 final exam documet compler design elements
Ch-2 final exam documet compler design elements
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
 
data structures and algorithms Unit 4
data structures and algorithms Unit 4data structures and algorithms Unit 4
data structures and algorithms Unit 4
 

Recently uploaded

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Exp 1

  • 1. CSE 1111 Fundamentals of Computer and Computing Lab Exp 1 – scanf, printf and variables Department of Computer Science and Engineering University of Dhaka
  • 2. Instructions • Solve all the problems using only scanf, printf and simple arithmetic operations. • You are not allowed to use any if else, loop or any other advanced constructs. • You are not allowed to discuss to each other. Please ask your teacher about any concerns. 09-May-16 2
  • 3. Today’s experiments - 1 • s = ut + (at2)/2. Take as input u, a and t. Calculate s using the formula. Print the value of s. 09-May-16 3
  • 4. Today’s experiments - 2 Given an angle (in degree), convert that to radian and show sin and cos of that angle (up to three decimal places). (use functions from math.h header file) Example: Enter angle: 60 Radian: 1.04 sin(60) = 0.866 cos(60) = 0.500 09-May-16 4
  • 5. Today’s experiments - 3 Take a number n as input and show the multiplication table for n. Example: Enter n: 7 Multiplication table for 7 ****************** 7 X 1 = 7 7 X 2 = 14 7 X 3 = 21 7 X 4 = 28 7 X 5 = 35 7 X 6 = 42 7 X 7 = 49 7 X 8 = 56 7 X 9 = 63 7 X 10 = 70 ******************* 09-May-16 5
  • 6. Today’s experiments - 4 Given two time find the absolute difference between them in minutes. You may assume that times are given in 24 hour format and the first time is always smaller than the second. That means if the second time looks smaller, its from the next day (example 2). You cannot use any if else to solve the problem. Example 1: Enter first time: 11 20 Enter second time: 12 40 Difference: 80 minutes Example 2: Enter first time: 13 20 Enter second time: 12 40 Difference: 1400 minutes 09-May-16 6
  • 7. Today’s experiments - 5 Write a program that will take a 6 digit integer number as input and show each digit of the number in a separate line. Also, print the sum of digits. Example: Please enter a 6 digit number: 349701 Digits are: 3 4 9 7 0 1 Sum of digits = 24 09-May-16 7