Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

We have a 4 x 4 two dimensional array. Fill it with random values from 1 to 100. Write a code to take transpose of the matrix. The following array is shown as an example:



1 2 3 4



5 6 7 8



9 10 11 12



13 14 15 16



BECOMES



1 5 9 13



2 6 10 14



3 7 11 15



4 8 12 16




Create an array of size 5x5 first fill the array with random values between 1 and 100, print it in straight and reverse order. Then fill that array from the user, print it in straight and reverse order.

Create an array of size 10 fill the array from the user. Then ask the user for the order of sorting ascending or descending. And sort the array using bubble sorting algorithm.

Write a program that declares 2 integer arrays x, y of size 10 each. The program then reads values for x and y arrays from the user (use some common values).



Finally the program finds the common values in x and y and prints them. If there is no common values in x and y print “There is nothing common between array x and y”.




Your boss sent you a notepad file called numbers.txt containing an



unknown number of integers. He requests you to write a single program



that a) reads these numbers into an array b) checks whether the file



has correctly opened c) prints out the average of all the numbers in the



array d) then program should search the array to see whether integer 150



is present e) finally the program should print out all the positive numbers



in the array. [20]




Create a class called Cuboid with the data members: length (float), breadth (float) and height (float). Use an inline function and calculate the area of the base using the formula = length * breadth and print it.


Define another member function and calculate the total surface area of the cube using the formula = 2*(length*breadth + breadth*height + height*length) and print it.


Define a friend function to calculate the volume of the cuboid using the formula = length*breadth*height. After calculating the volume, calculate the amount of liquid that can be stored if 1𝑚3 can store 100 liters of liquid.


3. In or Out

by CodeChum Admin

I'm quite into games now, so how about we play In or Out! When a given number is even, the team scores so we shall print "In", but if it's not an even number, then we print "Out". Simple, right?


Now let's get this game started.


Input

A line containing an integer.

35

Output

A line containing a string.

Out




Write a program to:

a)      Initialize an array of 8 entries for serial number.

b)     Set the value of 5th serial number to 89.

c)      Set the value of 3rd serial number to the addition of first two serial numbers.

d)     Display the serial number on 2nd index

e)     Print the whole array




The function Power, which raises the integer number x to the power n, can be defined recursively as follows: Power(x, n) = 1 for n = 0 Power(x, n) = x * Power(x, n-1) for n > 0 (i) Using the above definition write the recursive function Power(x, n) in C. (ii) Rewrite the recursive function Power(x, n) in an iterative form. (iii) Write the main function and test the above written functions. Note: You can write one program and test the functions or you may write two separate programs for each part (i) and (ii).


Guessing numbers

Rahul is playing a guessing number game with computer . the objective of the game is to guess the number that computer think . A guess is "correct" when the guess exactly matches the computer number. After each guess by Rahul, the computer will give a score comprising black & white coins:

Black coins = guessed digit is present in the computer's number and in same position

white coins = guessed digit is present in the computer's number and in another position

your task is to find out the number of black coins and number of white coins

Input:

The first line of input contains two space-separated integers

denoting the Rahul's Guess and the computer's Number.

Output:

The output should be a string denoting the number of Black coins and the number of White coins in the format as shown in the same output.

sample output:

given rahul=1423, computer=1234

so the output should be "blacks : 1 whites : 3 "

sample input2;

1423 5678

blacks  :  0 whites : 0


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS