# Implementation using C in programming lab class when being Teacher Assistant.

### Related tags

Learning, Reference and Tutorials c basic-programming

# C Programming Lab

Implementation using C in programming lab class when being Teacher Assistant.
The problems are here

## Problems and Description

• Week2
• week2-1
• Description: A man walks X km in Y hours in the same direction. What is the man's velocity in km/h for the journey?
• Input: Input contain two number in a line and separate by a single space, first number stand for distance in km, second number stand for time in hour.
• Output: A number stand for velocity in km/h, please rounded to six decimal places.
• week2-2
• Description: Read a 4 digit number, reverse it and display it.
• Input: A 4 digit number, first digit is not 0.
• Output: A 4 digit number after reverse.
• week2-3
• Description: Read in a number, round it down to an integer and display on screen.
• Input: A number.
• Output: Display the integer after round down.
• week2-4
• Description: Please write a program allow user input two integer and print out the result of addition subtraction multiplication division and modulo of two integer.
• Input: Two integer separate by a single space.
• Output: See sample output.
• week2-5
• Description: Please write a program allow user input two floating point number and print out the result of addition, subtraction, multiplicationanddivision of two number.
• Input: Two floating point number separate by a single space
• Output: See sample output
• week2-6
• Description: Gave you a number n, please find the maximum even number less than or equal to n.
• Input: An positive integer n.
• Output: An largest even number less than or equal to n.
• Week3
• week3-1
• Description: Please input an integer, determine if the integer is odd or even.
• Input: Just an integer.
• Output: output "odd" if the integer is odd, "even" if the integer is even.
• week3-2
• Description: Read in two integer m and n, determine if m is multiple of n.
• Input: Input will be two integer m and n separate by a single space.
• Output: Please reference the sample out
• week3-3
• Description: We use two points to present a segment in one dimensional coordinates. Give you two segment, your job is to determine two segment are overlay or not.
• Input: Input consist 4 integer, first two present segment 1, and follow two present segment 2.
• Output: Print "overlay" if two segment overlay, "no overlay" if not.
• week3-4
• Description: Three segment length a, b, c, c has maximum length, if a + b > c than these three segment can construct a triangle. If a * a + b * b = c * c it will be a "right triangle", if a * a + b * b > c * c it will be a "acute triangle", if a * a + b * b < c * c it will be a "obtuse triangle". Write a program to determine what kind of triangle it will be.
• Input: Input consist three integer a, b, c, c will be the maximum value.
• Output: 如果三個線段可以構成一個三角形，就輸出他是哪種三角形，如果是銳角三角形就輸出 "acute triangle" ，如果是鈍角三角形就輸出 "obtuse triangle" ，如果是直角三角形就輸出 "right triangle"。如果三個線段無法構成一個三角形則輸出 "can not construct"
• Week4
• week4-1
• Please write a program that can keep read in integer until 0, sum up all integer and print out the result.
• Input consist several integer until 0.
• sum of all integer.
• week4-2
• Please write a program read in an integer and print out all its factor.
• Input consist an positive integer.
• Print out all factors incremental ordering.
• week4-3
• Please write a program to determine if a number is prime or not.
• Input consist several test case. Every test case is just a integer. Input ended with 0.
• For every test case output "prime" if the input is a prime number, output "not a prime" if not.
• week4-4
• Please write a program, input a positive integer to represent the number of regular triangle layers, and print this triangle.
• A[1, 30] positive integer.
• Print this regular triangle.
• week4-5
• Please write a program for prime factorization.
• Input consist several test case. Every test case is just a integer. Input ended with 0.
• Please reference the sample output.
• week4-6
• Morse code is a character encoding scheme used in telecommunication that encodes text characters as standardized sequences of two different signal durations called dots and dashes or dits and dahs. Morse code is named for Samuel F. B. Morse, an inventor of the telegraph. Write a program allow user input a number and print out corresponding Morse code.
• Input is an integer number.
• Print out the corresponding Morse code.
• week4-7
• Given the square root of a positive integer N is between 0 and N, let the square root of N be x, a=0 is the lower bound, and b=N is the upper bound. Then there is the inequality a<=x<=b, square the inequality to get aa<=xx=N<=b*b, and let c = (a+b)/2 according to the root approximation through bisection, when square of c is greater than or equal to N, we update the upper bound and get a new inequality a<=x<=c, otherwise, we update the lower bound and get a new inequality c<=x<=b. The difference between the upper and lower bounds is called the error. Please design a program in which the user enters a positive integer and calculates the square root of the positive integer. Please be accurate to four decimal places.
• An integer n.
• Output the root of naccurate to four decimal places.

###### Tsuen Hsueh
Greetings! I am the founder of CSIE Tech Community(CTC), a writer in Medium for FAUN and Enlear Academy, and a core team member in GDSC NDHU, Secretary.
###### Simulation code for the specific PDP-10 serial number 32 at the Stanford A. I. Lab in 1974 as a solo processor with all the I/O devices simulated as on the PDP-10. Omit the co-processor PDP-6 sn16.

KA10 sn32 Synopsis This repository contains software and documentation for running the unique PDP-10 KA serial number 32 that was at Stanford in July

4 Aug 7, 2021

413 Aug 2, 2022
###### cs49n class materials: stanford autumn quarter 2021

CS49n (Aut, 21): using bits to control atoms. Overview This is a lab-based class. It is structured where you will write the code to control 1-2 hardwa

5 Dec 24, 2021
###### A custom,multifunctional class template for arrays which supports lambda functions for removing and selecting

C++ Array Template Class This is an implementation of a template class for storing data in any type.It includes user-friendly interface with lots of h

2 Dec 8, 2021
###### uniptr_t - C++ Pointer Utility Class

uniptr_t - C++ Pointer Utility Class uniptr_t stands for univerasl pointer. It's a small C++ class wrapping any pointer type. It removes the need to c

3 May 15, 2022
###### Programming-Basics - This Repository Contains source codes of various programming languages. Please Contribute to make this Useful.

Programming-Basics About ❓ Want To Start your Open-Source Journey Without Facing Difficulties?,If Yes, Then You Are at The Right Place! ?? Don't Know

62 Jul 31, 2022

10 Feb 4, 2022
###### ES2C4 C Programming Labs

ES2C4 C Programming Labs University of Warwick, School of Engineering, ES2C4, C Programming Labs Disclaimer: If you are here to copy my answers I stro

6 Nov 23, 2021
###### Competitive Programming Language MM

MM Language MM Languageは、競技プログラミングのために開発中のプログラミング言語です。 どんなことが可能なのかは、examplesおよびexamples_outputsを参照ください。 まだ開発中の言語であるため、諸々不備があり、コンパイルエラーの行数表示さえまともに出せない状

19 May 13, 2022
###### Repository for the Object-oriented programming course for academic year 2020/21

Object-Oriented Programming 2020/21 Repository for the Object-oriented programming course for the 2020/21 academic year. Structure exam -- tasks given

19 Oct 21, 2021
###### System Programming 2021 Spring

sp-labs System Programming Labs 2021 Spring Repo 文件说明 lab: 实验指导书 & 题目。 answer_template: 提供对应 lab 的参考作答模板。建议将图片放至对应的img/文件夹下，使用 Markdown 编写，最后通过 Typora

30 Apr 23, 2022
###### My evolution in competitive programming especially with C++ on differents website

competitive-programming My evolution in competitive programming especially with C++ on differents website. A typical example of an exercise/problem We

4 Jun 15, 2021
###### the kyanite programming language

Kyanite Kyanite is a small passion-project programming language intended to be light-weight and simple to use. You can read more on the language itsel

5 Aug 19, 2021
###### A simple messenger written in C for Principal of Programming course final project

Mohsenger A simple messenger written in C for Principal of Programming course final project Implemented by socket and sqlite3 dbms and single thread c

6 Sep 25, 2021
###### λQ: A Simple Quantum Programming Language based on QWIRE.

λQ λQ: A Simple Language based on QWIRE which can be compiled to QASM. The name λQ means lambda calculus with quantum circuits. This is a term project

5 Jul 11, 2021
###### A guide for C Programming from the perspective of a Pulchowk student (IOE).

C-Programming-Guide This README contains a list of resources that will be required as you get used to programming in C.

26 Jul 25, 2022
###### Modern C++ Programming Course (C++11/14/17/20)

Modern C++ Programming Course (C++11/14/17/20)

489 Aug 6, 2022
###### A comprehensive catalog of modern and classic books on C++ programming language

A comprehensive catalog of modern and classic books on C++ programming language

337 Aug 6, 2022
###### A minimal, toy programming language implemented in C++ and STL.

od Programming Language Mod (or ModLang) is a minimal, toy programming language implemented in C++ and STL (Standard Template Library) with no other e

26 Apr 28, 2022