SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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 writingTeacherCyreneCayanan
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
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.pdfJayanti Pande
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
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 17Celine George
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Dernier (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
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
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
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
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

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