What is wrong with the following programs(one problem each)? nclude ing namespace std; t main() { int sum, i; for(i=1;i<=10;i++) sum+=(i*i); cout<<"The sum of the first 10 squares is " #include using namespace std; int main() { int i, large, x; cout<<"enter a value\n"; cin>>large; for (i=2;i<=10;i++) <>x; if (large
Q: Exercise 5 #include using namespace std; int squareByValue ( int): // function prototypes void…
A:
Q: Convert the following C++ programs into Pep/9 assembly
A: #include <iostream> using namespace std; void minimum (int i1, int i2) { if (i1 < i2)…
Q: #include using namespace std; int Fibonacci(int n) { /* Type your code here. */ } int main() {…
A: Required c++ code according to template provided is given below:
Q: This expands the previous work to enable handling multiple employees. You will do this by…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int…
Q: using namespace std; evoid wth(int i, int &k) { i = 1; k = 2; 4} int main() { int x = 0; wth(x, x);…
A: Code Snippet #include <algorithm> #include <iostream> #include <vector> using…
Q: Q2/ Write c# function of this following int min ; x = 4; float 2 = 1 ; long y = 1; int a {1,3,9, 10,…
A: As per the given question, we need to implement the following functions in c#: 1. MinMax(a, out m,…
Q: Trace the following programs and write the generated output: #include using namespace std; class B{…
A: Given: #include<iostream> using namespace std; class B { public: char c; float b;…
Q: /*Rewrite the given program using function overloading*/ /* Rewrite the given program using the…
A: Task :- Rewrite the given C++ code using Overloading concept. Overloading :- If two methods have…
Q: The following code C++ uses pointers and produces two lines of output. What is the output?…
A: Pointers are variables in a programming language that store the memory address of another variable.…
Q: Convert the following C++ programs into Pep/9 assembly 1) #include using namespace std;…
A: Mnemonics used in the program: ADDSP: Add to stack pointer (SP). Memory allocated for local…
Q: A structure quadratic has been declared as follows: typedef struct { float a; float b; float c; }…
A: Define a struct named quadratic with three float members: a, b, and c.Define a function named…
Q: #include #include Collapse int FunctionOne (int m, int n) { if (m == n) { 4 Exercise 5.3 6. 7 8…
A: 1. When we try to run FunctionOne() with values 2,5 it will run as given below:- FunctionOne(2,5)…
Q: What is the use of line number 11 3 using namespace std; 4 int min(int x,int y) 50 { 6 cout>>>>y; 13…
A: Given C++ program contains, A min function with variables x, y and in this function the value of x/y…
Q: Please explain this code: #include #include using namespace std; int main() { char…
A: This is C++ code. In this question, we have to explain the code. In the end we will also attach the…
Q: output
A: EXPLANATION:- Integer a= 5,b =3 pass these values to the function add(5,3) and it return the result…
Q: HELP ME FIX MY CODE #include using namespace std; void breakapart(int n, int &a, int &b, int…
A: EXPLANATION: Following is the corrected code for representing the required result: #include…
Q: able to keep track // frequency of copy operation (marked below), an
A: The code is shown as,
Q: Consider the following code snippet:
A: Consider the following code snippet:int arr[3] [3] = { {1, 2, 3}, {4, 5, 6 }}; int val = arr[0][2] +…
Q: The following code C++ uses pointers and produces two lines of output. What is the output?…
A: Declare two integer variables v1 and v2. Declare two integer pointers p1 and p2. Assign the address…
Q: Remove error from following cpp program: CODE: #include #include using namespace std; class…
A: Step 1:- Error:-
Q: Convert the following C++ programs into Pep/9 assembly
A: Given: #include <iostream> using namespace std; void minimum (int i1, int i2) { if…
Q: What will the following program display? #include <iostream> using namespace std;// Function…
A: Code #include <iostream> using namespace std; void showMe(int arg);// Function prototype void…
Q: Find and Correct Errors and print output #include using namespace std; int fun(int a, char…
A: Please upvote for my efforts. !. ANSWER code: #include<iostream>using namespace std; void…
Q: C++ programming
A: answer is given as
Q: what is wrong with this programming? #include #include using namespace std; int main() { string…
A: #include <iostream>#include<bits/stdc++.h>using namespace std;int main(){string…
Q: Convert the following C++ programs into Pep/9 assembly 1) #include using namespace std; void…
A: MNEMONICS USED: ADDSP: Add to stack pointer (SP). Memory allocated for local variables at run-time.…
Q: Please fill the blanks for C. /*getchar VS scanf*/ #include #define length 70 //Putting all…
A: getchar: The getchar function is part of the <stdio. h> header file in C. It is used when…
Q: I need to get an Algorithm (pseudocode and flowchart) note: give a computerized answer. #include…
A: Required : 1. Pseudo code 2. Flowchart
Q: #include using std::cout; void number_range(int m, int n); int main() number range(2, 5); void…
A: The initial value of m=2 and n=5 which is passed to function number_range. Then the function number…
Q: Instruction: Explain the functions of each code per line to get the desired result.
A: //Code #include <iostream>using namespace std; int main(){ int r; cout<<"Enter…
Q: b) The following code fragment passes data by reference. Convert it to the one that passes data by…
A: #include <bits/stdc++.h> using namespace std; void exponen(double num); // Declaration the…
Q: void add(int *ptr1, int *ptr2, int *val) { *ptr1 += *val; *ptr2 += *val; }
A: #include <stdio.h> void add(int *ptr1, int *ptr2, int *val); // defination of add function…
Q: C PROGRAMr Trace the values of the variables and write output of the following: #include #include…
A: Trace:myStruct array is declared with 5 elements(name:myArray)Tracing for loop, which initializes…
Q: Question 1 is already done need help with the others though This is the C code I have so far…
A: As per our guidelines, we are supposed to answer only 1st three parts. Kindly repost the remaining…
Q: C++ Given code is #pragma once #include #include "ourvector.h" using namespace std; ourvector…
A: Answer: I have complete function as in given question.
Q: This expands the previous work to enable handling multiple employees. You will do this by…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int…
Q: 2:39 PM 07 jo EA 1ICUrOLLY CIIOICC What is the output of the following program: #include main () int…
A: When i =1 in for(i=1;i<=3;i+=1) We will enter the loop and now the for(j=1;j<=1;++j) loop…
Q: Explain the following code: #include using namespace std; int sum(int(*) (int), int);…
A: Explanation of the given C++ code:-
Q: explain this whole program with coments #include #include using namespace std; class publication…
A: Default constructors do not take any parameters. If a default constructor is not provided by the…
Q: Complete function RollSpecific Number() that has three parameters: a GVDie struct object, an integer…
A: The answer is given in the below step
Q: complete magic Square #include using namespace std; /*int f( int x, int y, int* p, int* q ) { if…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: Read the following program. int _tmain(int argc, _TCHAR* argv[]) { int a=6,b=3;…
A: The correct answer is given in step 2.
Q: Assume p1, p2, and p3 are pointers to integer numbers. As an exampl consider int n1 = 33; int n2 =…
A: Answer
Q: Question 1 is already done need help with the others though This is the C code I have so far…
A: Coded using C language.
Q: #include<string main () {char A[ ]="edc char B[ J="5432 strcny(B A):
A: 1- The result of A and B is, A=edcba B=edcba 2- strcpy() it is in-built method of…
Q: return 0; } //**** *********** *** ********** // countLetters // // task: This function counts the…
A: Algorithm: Start Read string Define 3 functions countLetters,countDigits,countWhiteSpaces for…
Q: #include using namespace std; int main() { double matrix[4][3]={{2.5,3.2,6.0},{5.5, 7.5,…
A: The problem is based on the basics of 2D arrays in c++ programming language.
Step by step
Solved in 2 steps with 1 images
- #include using namespace std; int main() int x=1,y=2; for (int i=0; i<3; i++) e{ x=x*y; 8{ } cout<Find errors / syntax error. Write line numberThis assignment is not graded, I just need to understand how to do it. Please help, thank you! Language: C++ Given: Main.cpp #include #include "Shape.h" using namespace std; void main() { /////// Untouchable Block #1 ////////// Shape* shape; /////// End of Untouchable Block #1 ////////// /////// Untouchable Block #2 ////////// if (shape == nullptr) { cout << "What shape is this?! Good bye!"; return; } cout << "The perimeter of your " << shape->getShapeName() << ": " << shape->getPerimeter() << endl; cout << "The area of your " << shape->getShapeName() << ": " << shape->getArea() << endl; /////// End of Untouchable Block #2 //////////} Shape.cpp string Shape::getShapeName() { switch (mShapeType) { case ShapeType::CIRCLE: return "circle"; case ShapeType::SQUARE: return "square"; case ShapeType::RECTANGLE: return "rectangle"; case…#include using namespace std; void myfunction(int num2, int num1); lint main() { my function (5,2); return 0; } void myfunction(int num1, int num2) {if (num1>3) cout << "A1"; else if (num1<3) cout<<"A2"; else cout<<"A3";} O A2 O A1 O A3 A1 A2 A310. a. Point Out errors: #include void main() { char arr[8]="Rhombus"; int i; for(i=0;i #include void main() { char *str1="United"; char *str2="Front"; char *str3; str3=strcat(str1,str2); printf("\n %s",str3); [- [- c. Compare Union and Structure.int func(int a, int b) { return (aC. #include int main() { char name[20]; printf("\nEnter your name :"); gets (name) ; printf("\nYour name is "); puts(name); }Please explain this question void main() {int a =300; char *ptr = (char*) &a ; ptr ++; *ptr =2; printf("%d", a); }37. #include int main() { int num = 5; printf(" The value of num is %d ", num ); What is printed?Recommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill EducationDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education