id my_func (int i, int& j) { int k; k = i + 6; i = i * 2; j = i + 3 + k; What is the output of the follo t x1 = t x2 = 3; t x3 = 15; lc(x1, x2); ut <く x1くくr e くく x2 くくr くく 2;
Q: nclude ing namespace std; ol Facto(int* pSquared, int* pCubed, int n); t main() int number,…
A: Given code contains the functions calling and called. Those contains the methods squared and cubed…
Q: IN C++ Only Jessie has a lot of cooking with her (N). He often remembered the first few letters of…
A: It is defined as a powerful general-purpose programming language. It can be used to develop…
Q: main.c 10. Lucky Customer by Jay Vince Serato E Run Tests We have a special promo here in our…
A: According to the Question below the solution: Output:
Q: int main() { int i, salary[10], range[9]={0, 0, 0, 0, 0, 0, 0, 0, 0}; double gross[10], total[10];…
A: The regular expression (RE) contains the symbol 0 and 1 only. The expression is:…
Q: plete the whole code a..
A: The code is below:
Q: # include main () {int i, j; int A[4][4]; for (i=0; i<=3; i++) for (j=0; j<=3; j++) {- for (i=0;…
A: Given: The statements to generate 4x4 A array
Q: int num; scanf("%d", &num); int n1; int pid = -1; for (int i=0; i<2; i++) { if(pid) { n1 = num%10;…
A: The above code is written in C language. when input is specified as integer type then it only…
Q: int s=0; for(int c=2;c<310;c+%3D2) cout<<c<<" "; HE S+=C;
A: A loop is used for executing a block of statements repeatedly until a particular condition is…
Q: nput a value for the variable y so that the variable x becomes 4 after the code executes.…
A: According to the Question below the Solution:
Q: What is the value of num3 after the following code is executed: int num1; int num2; int num3; num1 =…
A: value of num1 is 15.
Q: #include using namespace std; const int y = 1; int main () ( int static y - 2; int i = 3, j - 4, m…
A: The output along with the explanation is given below:
Q: int vall = 7; while (vall <= 10); vall+=val1%5;
A: 1-The loop will not execute any single time. Because while loop syntax is wrong here. So, here…
Q: #include using namespace std; int lookup(int arr[], int num, int cnt for(int i = 0;i<cnt;i++){…
A: Here the code :- hlt: b 120000c50 <hlt> nop lookup(int*, int, int): daddiu sp,sp,-48 sd…
Q: include using namespace std; bool isPalindrome(int x) { int n=0,val; val = x; while(x > 0) { n = n *…
A: Solution :
Q: int i,j; for(i=1;ii;--j) cout<<"-"; } **_* ** **. ***.
A: CODE WITH OUTPUT:-
Q: def strPattern(mystr): lenght = len(mystr) mystr1 = "" for i in range(lenght - 1): mystr1 = mystr1 +…
A: Please find the answer below :
Q: struct ID { int x; int y; }; struct name { ID r; }; int main() { name a[2]; for (int i=0;i<2;i++) {…
A: Given code is struct ID { int x; int y; }; struct name {ID r; }; int main() { name a[2]; for(int…
Q: int z = 2.2; %3D if(x 3) z = X + y; if(z > -1){ cout <« "z is " + y; } else cout <« "z is + z;
A: int z = 2.2 would result in z = 2 as decimal would be ignored. And instead of + I am taking <<…
Q: 2 #include using namespace std; void func1(int &) ; void func2 (int &, int &) ; void func3 (int,…
A: In func1,func2: Arguments are passed to the function by sending the reference not value. So any…
Q: main(){ int M-20; if(M=340) cout<<M:} 20 O 40 O 21 O
A: Answer: Nothing will be printed last option i guess because its missing the first 3 options are…
Q: Write the functions with the following headers:# Return the reversal of an integer, e.g.…
A: NOTE: Since programming language is not mentioned. Therefore answering questions in python language.…
Q: using namespace std; eint div_2(int a){ if(a%2==0){ return 1; return -1; } 4} evoid div_6(int b){ }…
A: Program always start frommain function. main function call div_6(12) and it pass 12 to the function.…
Q: int z=3, s um =0; while (z<7) { Z+=2; Sum-Cumt7 .
A: The answer is as follows:-
Q: include doublevalue (int z) { z*=2; --z; return z;} int main( ) {int a, b; a=16; b=23;…
A: In the above program, aa,bb,f are not declared doublevalue function is returning int value, but…
Q: #includeusing namespace std;main(){int myarray[20] ;int sum =0;for ( int i=0; i<20 ; i++) cin <<…
A: Answer: FALSE The program is wrong and has many errors. The correct program is:
Q: Compute: z = V[x] – y 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int…
A: In the above program, we have to compute the value of z.Here We have used setprecision which is used…
Q: What will be the output of foll #include void fun1 () { cout<<"c++"< void fun2 () cout<<"Jordan"<<"…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: include
A: 1) Computers store data in memory in binary. One thing that is often overlooked is the formatting at…
Q: static void Main(string[] args) { Console.Write("Enter seconds: "); int iseconds =…
A: In C++, we have to_string() method which converts the numerical value to string.
Q: void minimum (int i1, int i2) { if (i1 > n >> m; minimum (n, m); return 0; }
A: .file "p.cpp" .text .section .rdata,"dr" _ZStL19piecewise_construct:…
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: What works: Input works if it is in the range of 5 and 95 included 5 and 95. Input works if it is…
Q: Add an overloaded output operator for the Direction type. It should output "North, "South", "East"…
A: Enumeration value can also be used to control a switch statement. It is necessary that all the case…
Q: int func(int a, int b) { return (a<b)? a: b; } int main( ) { int x = 1, y = 3, z = 5; int w; w =…
A: Answer: 1
Q: int x = 5, y = 2, z = 3; if ( x z) cout 2 ) { cout << z <<" "<< y-x << endl; cout << z * (x + y)<<…
A: The program is written in C++ Language. Please find the source code and output in the below steps
Q: int num2) if (numl > 0) for (int i = 1; i <= num1; i++) num2 num2 * i; return num2; else if (num2 0)…
A: given: int Secret(int num1, int num2){ if(num1<0) { for(int i = 1; i<=num1;i++) {…
Q: Coding Challenge Write a function named aidojo that takes a an integer parameter ʼn and return a…
A: Sample Output Screenshot:
Q: int x=22, y=17; if((x>30 || y<2)) cout<<"BAHRAIN"; else cout<<"MANAMA"; A MANAMA B BAHRAINMANAMA C.…
A: The given code is: int x=22, y=17 here x is not greater than 30 so first condition is false. y…
Q: C++ main(){int i; int j; int y; i=9;j=3; y=(i/j)-(3*i^2)/9; cout<<y;}
A: #include <iostream>using namespace std; int main() { int i; int j; int y; i = 9;…
Q: Look at the following code. int x = 7; int *ptr = &x;What will be displayed if you send the…
A: Given: Look at the following code. int x = 7; int *ptr = &x;What will be displayed if you send…
Q: void kar2(char "b, char "a, char "c) "a = 'b'; "b='c'; *c ='a';
A: Output:
Q: using namespace std; int sumDigits(int mylnt); int main() int mylnt; cout > mylnt; int Integer =…
A: C++ Language: #include<iostream>using namespace std;int main() { int x, s = 0; cout…
Q: int main(int argc, char **argv) { float *rainfall; float rain_today; // rainfall has been…
A: Here is the answer:-
Q: i cant use static void Main(string[] args) for this assignment for C# this is what I have to work…
A: required: Write a program named GuessingGame that generates a random number between 1 and 10.…
Q: using namespace std; int main() int i, m=0,n=4; float arr[100] (55,66,88,1); for(i=0; i<n; ++i) {…
A: The above is a cpp program. This program is finding the smallest element in array by continuously…
Q: int_tmain(int argc, _TCHAR* argv[]) { int A=35, B=65; if(A>=40 || B<=75) { cout<<"lf will execute";…
A: The given problem is related to C++ programming and operators in the programming. The requirement is…
Q: The special case return value that will terminate the following code i
A: The special case return value that will terminate the following code is ____________________. int…
Q: int a=3, b=5, c=7, d=-2; if (d > 0) cout << a + b *c << endl; else cout << a * b -c<< endl; A -13 B…
A: This question of condition checking or conditional checking. So, let's just talk about this…
Q: Sandwich Maker Write a program that asks users for their sandwich preferences. The program should…
A: The advantage of Python allowing elements of a list to be of various types is that we can store all…
Q: nsider: lic static void printAll(int[] a) { N = a.length;
A:
Evaluating Output
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- JAVA CODE PLEASE Functions With No Parameters and Return Values Quiz by CodeChum Admin Create a function named banner that prints “CodyChum” with a newline. In the main function, write a program that accepts an integer input which would serve as an inclusive stopping point of a loop iteration that starts at the value of 1. If the number that loops through the range is divisible by either 2 or 3, then call the banner function, otherwise just print the number. Input 1. One line containing an integer Output First line is the integer user input. Succeeding multiple lines containing an integer or “CodyChum” 10 1 CodyChum CodyChum CodyChum 5 CodyChum 7 CodyChum CodyChum CodyChum6.47 LAB: Replacement words (JAVA) Write a program in java that finds word differences between two sentences. The input begins with an integer indicating the number of words in each sentence. The next input line is the first sentence and the following input line is the second sentence. Assume that the two sentences have the same number of words and no more than 20 words each. The program displays word pairs that differ between the two sentences. One pair is displayed per line. Ex: If the input is: 6 Smaller cars get better gas mileage Tiny cars get great fuel economy then the output is: Smaller Tiny better great gas fuel mileage economy Add a method named readSentences to read the input sentences into two String arrays. public static void readSentences(Scanner scnr, String[] sentence1Words, String[] sentence2Words, int wordCount) main() already contains code to read the word count and call readSentences(). Complete main() to display differing word pairs. Code starts here: import…5: CheckLetter.cpp) Write a program that adds a checkletter to an eight-digit number. The check letter should becomputed as follows: Break the number up into 4 two-digitnumbers. Add the four numbers together. Find theremainder after division by 26. The check letter is the letterin the alphabet that corresponds to the number justcomputed. (A=0, B=1, C=2, etc.) Print the original numberfollowed by the check letter. Use at least one ffunction thatreturns a value when you write this program.
- Functions With Parameters and No Return Values Quiz by CodeChum Admin Create a program that accepts an integer N, and pass it to the function generatePattern. generatePattern() function which has the following description: Return type - void Parameter - integer n This function prints a right triangular pattern of letter 'T' based on the value of n. The top of the triangle starts with 1 and increments by one down on the next line until the integer n. For each row of in printing the right triangle, print "T" for n times. In the main function, call the generatePattern() function. Input 1. One line containing an integer Output Enter·N:·4 T TT TTT TTTTThis is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to print the employee data to console void display(struct employees…int dizi3[2][3][2] = { {{0, 1}, {2, 3}, {3, 4}}, {{5, 6}, {7, 8}, {9, 10}} }; printf("%d ", *((int*)dizi3 + 6)); Explain the results by examining them.
- A postfix expression is an expression in which each operator follows its operands. Figureabove shows an examples of postfix expressions.The advantage of postfix form is that there is no need to group subexpressions in parentheses or to consider operator precedence. One may have used pocket calculators that require entry of expressions in postfix form.Write a program that simulates the operation of a calculator by scanning an integer expression in postfix form and displaying its result. The program should push eachinteger operand onto the stack. When an operator is encountered, the top two operands are popped, the operation is performed on its operands, and the result is pushed back onto the stack. The final result should be the only value remaining on the stack when the end of the expression is reached. This program scans a postfix expression and evaluates it. The Postfix expression must be followed by a space and a '?' to mark the end of the expression. One must use stack and the…(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 inclusive using initializeArray (from question 1) and counts the occurrence of each number in the array and graphs the information in the form of a bar chart or histogram—each number is printed, then a bar consisting of that many asterisks is printed beside the number. Here is a sample run of the program: Number Value Histogram 1…(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 using initializeArray (from question 1) and counts the occurrence of each number in the array and prints the occurrences. Note: Print time or times correctly. Hint: Declare another array called count that stores the number of each value as you count the numbers of the original array. Use printArray (from question 1) to print the values of count. Here is a sample run of the program: 1…
- Define an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle. Write a function triangleShape that takes as parameters three numbers, each of which represents the length of a side of the triangle. The function should return the shape of the triangle. (Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third side.) Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangleWrite a function called initializeArray that receives an array, its size, and two integers andinitializes the array with random values between the first integer and the second integer. Write anotherfunction called printArray that receives an array and its size and prints the array elements in a column. Writea test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive,and then prints the array using the above functionsJAVA CODE PLEASE Functions With Parameters and Return Values Quiz by CodeChum Admin Create a function named oppCase that receives one character input that is an alphabet. Return the opposite case of that character. In the main function, write a program that asks for a character input and assign it to a character variable. Call the oppCase function by passing in the character variable and assign the returned value to a variable. On the next line, print the value assigned to the variable. Input 1. One line containing a character Output Enter·a·character:·A a