Browse I
Alphabetical listing with fast deep pagination.
87858 items • Page 1734 / 1758
int allocate_memory(player_t** player_p_p, long int nplayers) { /* This function
int allocate_memory(player_t** player_p_p, long int nplayers) { /* This function allocates memory for a player_t pointer variable. Inputs: player_p_p - memory location of a player…
int binSearch(int arr[], int lo, int hi, int x) { int q = (low + high) / 2; if(a
int binSearch(int arr[], int lo, int hi, int x) { int q = (low + high) / 2; if(arr[q] <= x && arr[q + 1] > x){ return q + 1; } else if(arr[q] == x){ return binSearch…
int binarySearch(const vector & v, int k)? Implement a function that uses b
int binarySearch(const vector<int> & v, int k)? Implement a function that uses binary search to search for a given value in a vector of integers whose elements are in st…
int binarySearchlconst int 1I, iets,int key) int neint) Karami Siot const int ST
int binarySearchlconst int 1I, iets,int key) int neint) Karami Siot const int STZE18 int artsizE)-,,2, 3, 4 int key cost e kinter key: Replace the 7 return /This function retures …
int bintodec(string); // converts a binary number (represented as a STRING) to d
int bintodec(string); // converts a binary number (represented as a STRING) to decimal int hextodec(string); // converts a hexadecimal number (represented as a STRING) to decimal …
int compareTree(node *a, node *b); Description: A function that determines wheth
int compareTree(node *a, node *b); Description: A function that determines whether the trees rooted at a and b are correspond. (Meaning; if the preorder traversal of one of the tr…
int compareTree(node *a, node *b); Description: A function that determines wheth
int compareTree(node *a, node *b); Description: A function that determines whether the trees rooted at a and b are correspond. (Meaning; if the preorder traversal of one of the tr…
int congestedCity() { double tmp = 0.0; int tmpIdx = 0; double total = 0.0; for(
int congestedCity() { double tmp = 0.0; int tmpIdx = 0; double total = 0.0; for(int i=0; i<n; i++) { for(int j=0; j<5; j++) { int x = getClosestCity(i); //this function gets…
int f(int *i) return (101) 1 int main) int n 5 printf (dn) return 0 Output n- Qu
int f(int *i) return (101) 1 int main) int n 5 printf (dn) return 0 Output n- Question 22: What will be the output of the program? include int sun (int ptt1-int ) int temp0 for li…
int fib(int n) { if (n == 0) { return 0; } else if (n == 1) { return 1; } else {
int fib(int n) { if (n == 0) { return 0; } else if (n == 1) { return 1; } else { return fib(n - 1) + fib(n - 2); } } void main() { int result = fib(8); }
int find(int num1, int num2); int first, second; first = num1 * num2 second = fi
int find(int num1, int num2); int first, second; first = num1 * num2 second = first - num1 + num2; cout << find (15 , 25) <, endl; if (second > 50…
int fitsBits(int x, int n) { \"This algorithm attempts to \"slide\" the number t
int fitsBits(int x, int n) { "This algorithm attempts to "slide" the number to the left and back * to the right based on the number of bits entered by the user. * If a number can …
int foo(int n) //Line 1 { //Line 2 if (n == 0) //Line 3 return 0; //Line 4 else
int foo(int n) //Line 1 { //Line 2 if (n == 0) //Line 3 return 0; //Line 4 else …
int fun(int *n) { *n /= 5; return -50; } void main() { int num = 25; num = num *
int fun(int *n) { *n /= 5; return -50; } void main() { int num = 25; num = num * fun(&num); } What is the value of num after the assignment statement in main, assuming: A) Ope…
int func( int arr[], int n) { int result = 0, i = 0; for ( i = 0; i
int func( int arr[], int n) { int result = 0, i = 0; for ( i = 0; i<n; i++) result ^= arr[i]; return result; } 6) What value will be returned if the function call is func(arr,5…
int func1 (int m, int n) { if (m==n || n==1) return 1; else return func1(m-1,n-1
int func1 (int m, int n) { if (m==n || n==1) return 1; else return func1(m-1,n-1) + n*func1(m-1,n); } Based on the function above; a) What prec…
int func1 (int m, int n) { if (m==n || n==1) return 1; else return func1(m-1,n-1
int func1 (int m, int n) { if (m==n || n==1) return 1; else return func1(m-1,n-1) + n*func1(m-1,n); } Based on the function above; a) What prec…
int func2(int m, int n) { if( n ==0 ) return0; else return m +func2(m, n-1); } a
int func2(int m, int n) { if( n ==0 ) return0; else return m +func2(m, n-1); } a) What is the limiting condition of the code above? a. n >= 0 …
int func2(int m, int n) { if( n ==0 ) return0; else return m +func2(m, n-1); } a
int func2(int m, int n) { if( n ==0 ) return0; else return m +func2(m, n-1); } a) What is the limiting condition of the code above? a. n >= 0 …
int getProductID(int ids[], string names [], int numProducts, string target) { f
int getProductID(int ids[], string names [], int numProducts, string target) { for (int i=0; i < numProducts; i++) { if (names[i] == target) return ids[i]; } return -1; // Not …
int green1=8; int green2=7; int yellow1=10; int yellow2=6; int red1=4; int red2=
int green1=8; int green2=7; int yellow1=10; int yellow2=6; int red1=4; int red2=5; int blue=9; int emergancy=A0; const int button1=2; int brightness= 250; int fadeAmount= 5; const…
int green1=8; int green2=7; int yellow1=10; int yellow2=6; int red1=4; int red2=
int green1=8; int green2=7; int yellow1=10; int yellow2=6; int red1=4; int red2=5; int blue=9; int emergancy=A0; const int button1=2; int brightness= 250; int fadeAmount= 5; const…
int i = 1, j = 1; for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { Console.Wr
int i = 1, j = 1; for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { Console.Write("…
int i; for(i=0;i
int i; for(i=0;i<256;i++) A[i]+=B[i]-1;// array that it don't understand how to do in mips assembly this is my assembly mips. #$t0=i #t1=256;constant #s0 array A #s1 array B .t…
int iItem; double dSubtotal; double dSalesTax; double dTotal; double dCost; // I
int iItem; double dSubtotal; double dSalesTax; double dTotal; double dCost; // Instantiations: Scanner cin = new Scanner(System.in); DecimalFormat dfCurre…
int k=7; if (k%3 > 1) k=10; else k=5; // what k will be? int k=17; if (k%5 > 2 |
int k=7; if (k%3 > 1) k=10; else k=5; // what k will be? int k=17; if (k%5 > 2 || k/5 > 2) k=10; else k=5; // what k will be? for(i=0; i < 5; i++) { ... } // How many …
int ledPin = 10;//use integer variable to store pin # for LED (global variable)
int ledPin = 10;//use integer variable to store pin # for LED (global variable) //connect LED this digital port/pin //the setup function runs once at startup void setup() { pinMod…
int loadArray(char* filename): This function takes the input file name and opens
int loadArray(char* filename): This function takes the input file name and opens the file. If unable to open the file, return 0. If able to open the file, it loads the data from t…
int logicalShift(int x, int n) { return 2; } /* * bang - Compute !x without usin
int logicalShift(int x, int n) { return 2; } /* * bang - Compute !x without using ! * Examples: bang(3) = 0, bang(0) = 1 * Legal ops: ~ & ^ | + << >> * Max o…
int main ( ) { /* Variable declarations */ int input, i , j ; /* Prompt the user
int main() { /* Variable declarations */ int input, i , j; /* Prompt the user for input */ printf("Enter an integer: "); scanf("%d", &input); for (i = 1; i <= i…
int main () { const float sixty_sec =60; //sixty seconds constint one_mile = 528
int main () { const float sixty_sec =60; //sixty seconds constint one_mile = 5280; //one mile is5280 ft const int one_kilometer= 3281; //one kilom…
int main () { const float sixty_sec =60; floatname1; float min; float first_sec;
int main () { const float sixty_sec =60; floatname1; float min; float first_sec; intsecondstwo; int secondsthree; cout <…
int main () { const float sixty_sec =60; floatname1; float min; float first_sec;
int main () { const float sixty_sec =60; floatname1; float min; float first_sec; intsecondstwo; int secondsthree; cout <…
int main () { string password; int length; bool Case=false, digit=false; cout
int main () { string password; int length; bool Case=false, digit=false; cout<<"Enter password:"; cin>>password; length=password.length(); …
int main () { } //----- DecryptCipherString() ----------------------------------
int main () { } //----- DecryptCipherString() ---------------------------------------------------------------------------------- // Decrypts a ciphertext string and returns the de…
int main() do {// Display the menu. cout
int main() do {// Display the menu. cout << " 1. Add a new record "; cout << "2. View an existing record by record number "; cout << "3. Change an existing recor…
int main() { // Define variables border and answer as type char // Define variab
int main() { // Define variables border and answer as type char // Define variable isSolid as type bool // Ask if the square is solid and save to the variable answer // based on a…
int main() { Junior J1; Freshman F1; J1.setValue(); F1.setValue(); J1.getValue()
int main() { Junior J1; Freshman F1; J1.setValue(); F1.setValue(); J1.getValue(); F1.getValue(); Junior J2(J1); Freshman F2(F1); J2.getValue(); F2.getValue(); Junior J3; J3=J1; Fr…
int main() { const int amount = 3; //variable r b g string sentence, filename, f
int main() { const int amount = 3; //variable r b g string sentence, filename, filename2; //variable to hold comments and filename ifstream inputFile, inputFile2; //open input and…
int main() { int i, j, n; printf(\"Example of schedule clause\ \"); printf(\"Giv
int main() { int i, j, n; printf("Example of schedule clause "); printf("Give an upper bound on the number of iterations: "); scanf_s("%d", &n); printf("n = %d …
int main() { int numCount, total; double average; total = 0.0; cout
int main() { int numCount, total; double average; total = 0.0; cout << "Howmany numbers do you want to average? "; cin >> numCount; for (int count = 0;count <= numC…
int main() { int value; // value is some positive number n int total = 0; // tot
int main() { int value; // value is some positive number n int total = 0; // total holds the sum of the first n positive numbers int number; // the amount of numbers float mean; /…
int main() { std::cout
int main() { std::cout << "Current account status:" << std::endl; PrintFileContents(ifile); std::cout << std::endl; std::cout << "New account status:" <…
int main() { string line; int row_count = -1, column_count = 1,line_number = 0,
int main() { string line; int row_count = -1, column_count = 1,line_number = 0, i; char nextChar; ifstream myfile("data.txt"); if(myfile.is_open()) { //open fi…
int main(int argc, char **argv) { // Initialize MPI ... ... ... ... if ( rank ==
int main(int argc, char **argv) { // Initialize MPI ... ... ... ... if ( rank == 0 ) { dest = 1; source = 1; sendTag = recvTag = 100; } else if ( rank == 1) { dest = 0; source = 0…
int main(int argc, char* argv[]) { char infixstream[100]; char postfixstream[100
int main(int argc, char* argv[]) { char infixstream[100]; char postfixstream[100]; printf(" Enter a mathematical expression :"); scanf("%s",infixstream); printf(" "); toPostfix(in…
int main(int argc, char* argv[]) { char infixstream[100]; char postfixstream[100
int main(int argc, char* argv[]) { char infixstream[100]; char postfixstream[100]; printf(" Enter a mathematical expression :"); scanf("%s",infixstream); printf(" "); toPostfix(in…
int main(int argc, char* argv[]) { char infixstream[100]; char postfixstream[100
int main(int argc, char* argv[]) { char infixstream[100]; char postfixstream[100]; printf(" Enter a mathematical expression :"); scanf("%s",infixstream); printf(" "); toPostfix(in…
int main(void) { //Local Declarations float a; float b; float c; float d; float
int main(void) { //Local Declarations float a; float b; float c; float d; float e; float f; float g; float h; float i; float j; float sum1; float sum2; // Statements printf("Pleas…
int main0 1 printr%d %duo\", ++x*y, x*y++); print\"hello: It world la\") print\"
int main0 1 printr%d %duo", ++x*y, x*y++); print"hello: It world la") print"t how are you 1?"); return 0; ) d int sum -65 double average 12.368 char ch b; printSum and Average a l…