(Display a pattern) Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Introduction to Programming with C++
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Database Concepts (8th Edition)
Starting Out with Programming Logic and Design (4th Edition)
C How to Program (8th Edition)
Starting Out with Java: Early Objects (6th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
- (Practice) Write C++ statements for the following: a.b=sinxcosxb.b=sin2xcos2xc.area=( cbsina)/2d.c= a 2 + b 2 e.p= | mn|f.sum= a( r n 1) r1arrow_forwardcan obtain the remainder of this division by using the % operator. For example, 10 % 3 is 1. In C++, the % can be applied only to integer operands; it cannot be applied to floating-point types. The following program demonstrates the modulus operator:arrow_forwardUsing the switch function, Write a C program that takes 2 Integers from the user and does a mathematical operation to the two values based on the case input: Case -1: Addition Case -2 : Subtraction Case -3: Multiplication Case -4: Division *All Variables types to be float *Add a default message: (“Invalid input, Insert 1,2,3 or 4)arrow_forward
- 3- Write a program C++to read a sequence of integers (n), then print the number of the positive and negative numbers.(Using functions) 4:42 /arrow_forwardQ5: (Count positive and negative numbers and compute the average of numbers) Write a program of C++ that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run: Enter an integer, the input ends if it is 0: 1 2 -1 3 0 The number of positives is 3 The number of negatives is 1 The total is 5.0 The average is 1.25arrow_forwardPurpose: - Write a c program - Generate some output with printf Use a variable Description: ------- -- Write a c program that prints: - Your nаmе - Your e-mail address Your High School - Home town - Current college - Current year in school - Your age in decimal - Your age in octal - Your age in hexadecimal on nine separate lines. Include a label before each piece of information you print. Treat your age as a single, stored numeric piece of data by placing it in a variable. Use conversion specifiers to produce the various bases for the one value in that variable. (See the textbook, or the Appendix to Polzin's notes for conversion specifier information.} *** Do not read any inputs, just produce the output. *** Ext Name: John Doe E-mail: jdoemymail.com High School: Central Minnesota High Home town: Lake Wobegon, MN Current College: Normandale Community College Current year in school: High school senior Age: 17 Age in octal: 21 Age in hexadecimal: 11 Notes: - Nicely format and label your…arrow_forward
- Q1. Write a program in C/C++ to print 10 random numbers between 20 and 30 Your code should include proper comments and should be executable and free from errors. (5 marks)arrow_forwardCODE USING C++ 5. Counting Num by CodeChum Admin To give you more of a challenge with a number's digits, let's try counting how many of a certain digit is present on a given number. Let's start coding! Instructions: Input two values in one line. The first one shall accept any integer from 0-9 and the other one shall take a random positive integer. Using a while loop, count how many of the first integer (0-9) is present in the digits of the second inputted integer and print the result (see sample input and output for example). Input A line containing two integers separated by a space. 2·124218 Output A line containing an integer. 2arrow_forward;Write a program in C++ to store marks of a class of 5 students and culcutate thir grades Input You will ask the user Enter name Enter Student ID Enter Mid-1, Mid-2 and Final marks of students :Process You will calculate total marks of each student and grade of each student :Output Show the name, marks and grade of each student in the classarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning