void fact(int num) { int k,f=1; for (k=1;k<=num; k++) f=f*k; cout<< f; int main() { int arri[3]=(3,2,1} ; for(int i=0;i<3;i++) fact(arri[i]); O 261 O 621 O 7 7 O 462
Q: #include using namespace std; int main() (char names[12][10]={"ahmed", "alaa", "hussain", "mahmod",…
A: Given C++ program contains a two dimensional array which contains six strings. Then it contains a…
Q: Cs10 Quiz 1 100% Name Login 27. Implement the following RECURSIVE function named starString: //…
A: Given: To write a recursive function to print the function starString.
Q: mplement a C function with the following header nt processPointers(int "p, int "q, int n) the…
A: int *p=a[0] will point the pointer to the first element of array. In array, the elements are stored…
Q: #include using namespace std; #define numVl 3 struct thNde { thNde* parent; int…
A: The code is written in C++ but instead of cout used printf for printing the outputs in code. Some…
Q: complete the code above by pep9 form assembly
A: Assembly code to find the minimum value: LDA MOV B, A LDA CMP B JC * MOV A, B STA HLT
Q: 2. Spell-it-out! by CodeChum Admin 1 Fincludecstdio. G Run Tests 3- int main){ Are you intimidated…
A: - We need to write the code for finding the character at an index in the array. - We are using C…
Q: CONVERT THIS TO JAVA PROGRAM #include #include using namespace std; int main() { int n;…
A: #include <iostream>#include <iomanip>using namespace std; int main() { int n;…
Q: a) 10 5 c) 10 5 7 9 int arr[4]= {10, 5, 7, 9}; for (int i- 0; i<2; i++) cout<<arr[i]<< " *; b) 10 5…
A: Given: Required: Output of the codes given above
Q: C Program / C Language Make a C program for the determinant of multidimensional array. The…
A: C Program/C language Make a C program for the determinant of multidimensional array. The…
Q: Assignment Declare an array of size 10. Fill the array with EVEN numbers. Then, loop through the…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of main function.…
Q: def recursive_sequence(self, n): """ Calculate a sequence where the value is 3 times the previous…
A: Program Code:- class Sequence: def recursive_sequence(self, num): if num<0:…
Q: b) Find the errors and correct them: 1) int sum 0;x; do{ cin<<x; Sumt-x;] while(x!-0.0) 2) (for int…
A: 1) variable names are case sensitive in CPP. The correct code is: int sum=0,x; do{ cin>>x;…
Q: Group Anagrams when given an array of strings in C++ Example: Input: ["eat", "tea", "tan", "ate",…
A: /** File : group_anagrams.cpp*/…
Q: C programming Language Recursion Question 1: Write c program to print the sum of the array…
A: Given: Question 1: Write c program to print the sum of the array elements using recursive function.…
Q: how to tweak the code so that when i enter for computer's ship it only shows whether i missed or hit…
A: So to do this you just have to remove the display_board() method from line no. 94 and line no.100…
Q: if L1={ab,b} L2={abb,bb} then L1L2= * O {ababb,abbb,abbab,bbab}
A: Introduction
Q: PROGRAMMING LANGUAGE: C++ // vectors: overloading operators example #include using namespace std;…
A: Output without any modification in the code:
Q: use pointers for example if the user enter ((8,4),(3,4),(7,2),(8,6),(3,1)) no limit to number of…
A: PROGRAM CODE: #include <iostream>using namespace std;int main(){ int arr[5][2], temp;…
Q: Pointers, modified) by Catherine Arellano We have a new game show that pits three people against…
A:
Q: Dry run required? for (i=n; i < 0; i--) { i = i + 4; }
A: for (i=n; i < 0; i--) { i = i + 4; }
Q: TotalResistance() { series_res=parallel_res=sp_res=0; } void seriesResistance(double…
A: The following are the name of the classes:- TotalResistance: This class is used to find out the…
Q: if L1={ab,b} L2={abb,bb} then LIL2= {ababb,abbb,abbab,bbab} O {ab,b,abb,bb} {ababb,abbb,babb,bbb}…
A: Given L1={ab,b} L2={abb,bb}
Q: Computer Science There are multiple errors in this code. Please list all the errors in the following…
A: In the given code, the following errors are:
Q: Gien. fr Cin; i>=l; 1=2){ for Cjsl; j L= lugli); j++){ ocn) ; Some thing Ocn) 3 3 what is te time…
A: Time complexity
Q: using namespace std; int main() [double degree [6] [2] =(30,40,10,70, 20, 30, 60, 70, 30, 10, 10,…
A: Answer: 60 Correct option is : 4
Q: C++ performing addition on complex data using class and object. should ask for real and imaginary…
A: C++ code: #include<iostream> using namespace std; class Complex { public: int…
Q: int isbivisiblebye(int num) (m ) reture isDivisibleBy6( ); num eturn 13 10) return reture…
A: #include <stdio.h> int isDivisibleBy6(int num){ if(num < 6) return…
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: Print all the elements of the array given below using a recursive C++ program. int gArrl[5] =…
A: Print all the elements of the array given below using a recursive C++ program.int gArrI[5] =…
Q: (c) Suppose data had a very large length, say 106. Clearly explain which statement in the function…
A: In the given sample of code, the inbuilt sort function, uses merge sort or quick sort to sort an…
Q: Let Z be an array of 10 elements with Z[i] = 1, for all i such that 0sis 9. The value returned by…
A: Code : int SimpleFunction(int Y[], int n,int x) { int total = Y[0],looppindex;…
Q: Q1 #include int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key);…
A: The Flowchart for the algorithm: Handwritten on image.
Q: 1. int findX(char array[]); returns 1 if the string contains a character "x or X" and O if otherwise
A: #include<stdio.h>//method returns 1 if the string contians a character 'x' or x//returns 0…
Q: java: // Class to do MergeSort and QuickSort on int arrays and test them public class…
A:
Q: C program only Hi! The 'divide' function should apply recursion. Please fix the code below.
A: In this question, a code is given in C language which divides the two numbers and we have to…
Q: 3) The grid of hashes (#) and dots (.) in Figure below is a two-dimensional array representation of…
A: Solution: The first step in solving these types of problems is figuring out every possibility that…
Step by step
Solved in 2 steps with 2 images
- remove the error from program( C programming language)#include<bits/stdc++.h>#include<math.h>using namespace std; class TotalResistance{double series_res,parallel_res,sp_res;public:TotalResistance(){series_res=parallel_res=sp_res=0;}void seriesResistance(double resistance[],int n);void parallelResistance(double resistance[],int n);void spResistance(double resistance[],int n);};void TotalResistance::seriesResistance(double resistance[],int n){for(int i=0;i<n;i++)series_res += resistance[i];cout<<"Total Resistance in series is: "<<series_res<<endl;}void TotalResistance::parallelResistance(double resistance[],int n){double temp=0;for(int i=0;i<n;i++)temp += (1/resistance[i]);parallel_res = 1/temp;cout<<"Total Resistance in parallel is: "<<parallel_res<<endl;}void TotalResistance::spResistance(double resistance[],int n){for(int i=0;i<n;i++)series_res += resistance[i];double temp=0;for(int i=0;i<n;i++)temp += (1/resistance[i]);parallel_res = 1/temp;cout<<"Total Resistance in…ii) In JAVA language input the elements of an integer array A of size 10 and find the count of all hills in the array. A[i] is a Hill if A[i-1]A[i+1]. A[i] >= 0 All elements of the array are unique.
- Java Programming language Please help me with this question1 finclude 2 tinclude 3 +define SIZE 10 4 5 void d_fcn (int *const, int ); 6 int main (void) 7日{ 8 int data[SIZE]; int i; 9 10 for (i=0;i#include using namespace std; main() { int num array[] = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; for (int n-1; n<-5;++n) { cout <« n<< * "; } return 0; Out put : 1 23 4 567 89 10 O Out put : 3 4 56789 10 O Out put : 2 3 45 67 89 10 11 O Out put : 1 2 3 456 Out put : 1 2 345 Not listed OT F In C++, array indices start at 0Recommended 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