Search this site
Embedded Files
Emanuele Giona
  • Home
  • Research and activities
    • Publications
    • Blog
    • Teaching
  • About me
    • Curriculum Vitae
  • πŸ”— LinkedIn
  • πŸ”— GitHub
  • πŸ”— Twitter
  • πŸ”— ORCiD
Emanuele Giona
  • Home
  • Research and activities
    • Publications
    • Blog
    • Teaching
  • About me
    • Curriculum Vitae
  • πŸ”— LinkedIn
  • πŸ”— GitHub
  • πŸ”— Twitter
  • πŸ”— ORCiD
  • More
    • Home
    • Research and activities
      • Publications
      • Blog
      • Teaching
    • About me
      • Curriculum Vitae
    • πŸ”— LinkedIn
    • πŸ”— GitHub
    • πŸ”— Twitter
    • πŸ”— ORCiD

Lecture 2
Back to IoT Lab A.Y. 2022/23

Written: 2023/03/16

Tags: C++, exercises, lecture 2, operators, flow control, functions

Solutions
Exercise 1
Exercise 2
Exercise 3

Summary

Solutions to exercises proposed during Lecture 2, held on March 14th 2023.

Solutions

Exercise 1

Write a program that prompts the user to insert an integer value and sums its digits, printing them at the end (e.g. [Input] 76 [Output] 13).

Exercise 2

Write a program that includes a function that swaps the contents of two float variables, printing the two variables before and after function invocation (hint: function should return void).

Exercise 3

Implement the for loop, without using while or do while loops, only using if and goto statements.

IoT Lab 2022/23

Google Sites
Report abuse
Google Sites
Report abuse