Preview

Phuck U

Satisfactory Essays
Open Document
Open Document
308 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Phuck U
Assignment Module: C Programming Language Learning Units: a) Introduction to C language b) Operators and basic types c) Control flow 1. Write a Program to input three positive integers representing the sides of a triangle and determine whether they form a valid triangle or not. 2. To round off a floating point number to the nearest integer, one adds 0.5 to the number and truncates it to an integer. Using this knowledge, try to figure out how to round a floating point number to the nearest tenth, hundredth, etc and implement the same. 3. Write a program that repeatedly ask the user to input a negative or positive number, and then echoes it. When the value 0 is entered, the program should terminate. It also keeps a count of how many of the numbers are positive and how many are negative. The program should print out these two totals immediately before terminating. 4. Write a program to which accepts a number n, and then finds the sum of the integers from 1 to 2, then from 1 to 3, then 1 to 4 and so forth until it displays the sum of the integers from 1 to n. For example, if the input is 5, the output will be 1 3 6 10 15 5 Write a program to implement the Russian Peasant Problem for multiplying two positive numbers using while or do…while loop. Russian Peasant problem is a method of multiplying two numbers together, using only division by 2, multiplication by 2 and addition. For example, if the numbers are 17 and 19are to be multiplied together, they are put at the head of two columns: The first number is divided by 2 and the second number is multiplied by 2. This process is continued until the number on the left reduces to 1.

You May Also Find These Documents Helpful

  • Satisfactory Essays

    = z) return true; else return false; } Problem 5 a. Output: 720 b. Output: 0 c. Output: 71 d. Output: 362880 Problem 6 a. Output: “Take Programming I.” b. Output:…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    cout << "You are in factorial program of C++. Please enter a +ve integer:- ";…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 7 assignment 1

    • 431 Words
    • 2 Pages

    7. Convert the While loop in the following code to a Do-While loop: int x;…

    • 431 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1310 Unit 1 Assignment 1

    • 2017 Words
    • 9 Pages

    | In this lesson the learners will:Show their knowledge of addition and subtraction using three and four digit numbers whilst interpreting given data from column and picture graphs.Compare different graphs and determine which graph is more suitable for the method of display.Interpret results given through column and picture graphs.…

    • 2017 Words
    • 9 Pages
    Powerful Essays
  • Good Essays

    This is our first individual assignment for Programming unit this semester. This assignment was given in December 2013, and submission date is on 10th February 2014.…

    • 1859 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    CS 220 – Programming w/ Data Structures: You have missed one assignment and one quiz. Your instructor has extended your assignment due date to this Sunday, April 10. Your instructor has also let you to take your Quiz # 2 during his office hours during this week. Let me know if you need additional support to study for this quiz. Your grade to date in this class is 30.2/37 81.62% B.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    6. Write a pseudocode statement that declares the variable total so it can hold real integers. Initialize the variable with the value 0.…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    An introduction to computer programming with an emphasis on problem solving will be presented. Specific topics include:…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    c. Modify the program of Part b so that at the option of the user, it displays…

    • 300 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Math/116 Syllabus

    • 2856 Words
    • 12 Pages

    This course introduces basic algebra concepts and assists in building skills for performing specific mathematical operations and problem solving. Students will solve equations, evaluate algebraic expressions, solve and graph linear equations and linear inequalities, graph lines, and solve systems of linear equations and linear inequalities. These concepts and skills will serve as a foundation for subsequent business coursework. Applications to real-world problems are also explored throughout the course. This course is the first half of the college algebra sequence, which is completed in MAT 117, Algebra 1B.…

    • 2856 Words
    • 12 Pages
    Powerful Essays
  • Satisfactory Essays

    Poop

    • 269 Words
    • 2 Pages

    Mathematics Objectives 1. Solve problems involving linear functions. 2. Develop algebraic expressions based on word problems, including those that require the use of parentheses, and evaluate the algebraic expression. 3. Recognize and create equivalent algebraic expressions (e.g., 2(a+3) = 2a+6). 4. Solve systems of linear equations and inequalities (i.e., equations with no quadratic or higher terms) in two or three variables both graphically and algebraically. 5. Apply algebraic techniques to solve a variety of problems (e.g., rate problems, work problems, geometrical problems). 6. Classify (as quadrilaterals, planar, solid, three-sided, etc.) familiar plane and solid objects (e.g., squares, rectangles, cubes, circles, spheres, rhombuses, trapezoids). 7. Define the concepts of length, area, perimeter, parallelism, circumference, volume, and surface area and calculate these when appropriate. 8. Identify the properties of angles in basic geometric figures. 9. Construct formal, logical arguments, proofs, and constructions. 10. Determine how changes in dimensions affect the perimeter, area, and volume of common geometric figures and solids. 11. State the Pythagorean Theorem and its converse. 12. Solve problems using the Pythagorean Theorem and its converse, and the properties of complementary, supplementary, vertical, and exterior angles. 13. Define the properties of complementary, supplementary, vertical, and exterior angles. 14. Compute the mean, median, mode, and range of a collection of data. 15. Identify potential sources and effects of bias in a given statistical analysis. 16. Calculate probabilities using complementary, mutually exclusive, dependent, and independent events. 17. Construct logical arguments and proofs based on the congruence, similarity, or lack thereof, of two figures. 18. Compute simple combinations and permutations using fundamental counting principles.…

    • 269 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Wk6AssgnNixL

    • 1398 Words
    • 7 Pages

    The Latin American subtraction algorithm could cause confusion among students as they attempt to problem solve using this method. Students must remember that the number added to the minuend must also be added to the subtrahend (Laureate Education, 2013). The media clip “Latin American Subtraction” showed step by step how to solve 435-268 using the algorithm. One of the steps of this algorithm that can confuse students is that a ten was added to the 5 to create 15in the ones place, but a 1 was added to the 6 in 268 to make a 7 in the tens place. From observing the media clip, if a “1” is added to the minuend (top number) then it is considered adding ten, but if a “1” is added the subtrahend (bottom number) it is considered adding 1. Until students had a firm grasp and a solid foundation applying this method, there is much room for error.…

    • 1398 Words
    • 7 Pages
    Better Essays
  • Satisfactory Essays

    CMIS 102 Homework 3

    • 342 Words
    • 3 Pages

    Program Description - This program will allow a user to input their name and final grades from their courses and calculate their GPA accordingky. The amount of students as well as the amount of classes each student is taking, are undetermined.…

    • 342 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    EFT4 Task7 lesson plan

    • 1113 Words
    • 5 Pages

    1.3.8: Students will generate and solve two-step addition and subtraction problems and one-step multiplication problems based on practical situations. Model addition, subtraction, multiplication, and division in a variety of ways. Use mathematical vocabulary and symbols to describe multiplication and division.…

    • 1113 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    a. Students will demonstrate the meaning of multiplication and division of whole numbers through the use of a variety of representations.…

    • 1022 Words
    • 5 Pages
    Satisfactory Essays