Questions: 11 448

Answers by our Experts: 10 707

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

Write a program that loads several numbers from the keyboard,

asking in the meantime, the question "Do you want to finish: Y / N?"

At the end of the loop, program should display calculated values of:

the arithmetic averagemaximumminimum of given numbers.


Write a program to find the sum of all natural numbers in a given range [m,n]

which are divisible by number k. The values of all three parameters mnk,

should be read from the keyboard at the beginning of the program.




Create a program for circular linked list which perform some functions which are as follows:-


1:- Append Node


2:- Prepend Node


3:- Insert Node After a Specific Position


4:- Delete Node


5:- Update Node


6:- Display




1.      You are required to create another class cuboid that inherits from rectangle. Create a header file called “cuboid.h” and implementation file called “cuboid.cpp”.

a.     This class has width and length but it also has height.

b.     Create accessor and mutator of this class

c.     Create the following functions

                                                             i.     Compute surface area.

                                                           ii.     Overload the function from c-I to compute surface area of parallel sides

                                                         iii.     Overload the function from c-I to compute total surface area.

                                                         iv.     Compute volume.

                                                           v.     Compute the length and height from center of diagonals.


 


Make a program that will accept an integer and loop from 1 to that integer. Then, print all numbers from that range that are greater than 3.





We've already tried comparing 3 numbers to see the largest among all, so let's try a more complicated mission where we locate where among the 5-digit integer is the largest one. There are only 4 possible cases for this mission:





if the largest digit is the first digit, print "Leftmost"




if the largest digit is the third digit, print "Middle"




if the largest digit is the last digit, print "Rightmost"




if none of the above is correct, print "Unknown"




Now, show me how far you've understood your lessons!

Nishant does pretty weird stuff. Today, he wants to create a weird sequence.


According to Nishant, a sequence A of length N is called weird if:


N≥3

2⋅Ai>Ai−1+Ai+1 ∀i∈{2,3,4....,N−1}

Nishant wants to construct a long weird sequence to impress his weird friends, but there's a problem: he only knows how to count up to K, so the sequence can only contain integers in the range [1,K].


Help Nishant determine the length of the longest weird sequence he can construct using only integers from 1 to K.


Input Format

The first line contains a single integer T denoting the number of testcases. The description of T testcases follows.

The first and only line of each testcase contains a single integer K.

Output Format

For each testcase, print one line containing a single integer - the maximum length of a weird sequence which can be obtained using only integers in [1,K].


Constraints

1≤T≤105

2≤K≤109

Sample Input 1

3

3

5

1073

Sample Output 1

4

6

92



Input

required to input in two sequences. first sequence is the user will input the # of items which should be greater than 1 and not be greater than 30. If the input is outside the range display "OUT OF RANGE". After validating that the range is valid, the user moves on to entering the next sequence. second sequence will require the user to input the numbers.

Out

Once all the numbers are entered, the program will simply get the largest and smallest number from the second sequence. In addition, it will also count the number of times the largest number or smallest number occurred. If the user entered the same numbers in the second sequence, the program will display the largest number and the # of times it is repeated but will display "Smallest number is the same as the largest number." for the smallest number.


In

8
8 7 6 5 4 3 2 1

Out

8:1x
1:1x



15
-1 -2 -5 -1 -5 -1 -5 -2 -1 -2 -1 -5 -1 -2 -1

-1:7x

-5:4x


20

9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9


9:20x

Smallest number is the same as the largest number.







Program

Create a program that will accept a character array input with a maximum array size of 30 and will check if the input contains a number.


Sample Input #1

2sHO4p

Sample Output #1

Numbers Exist:24


Sample Input #2

love

Sample Output #2

No Number


Sample Input #3

g00d morn1ng (space between characters)

Sample Output #3

Number Exist:001


Input

The program will accept a single text input.

Output

After the user encodes his/her text input, the program examines the text's structure which includes:

  1. The number of letters (regardless if its uppercase/lowercase)
  2. The number of numeric characters
  3. The number of special characters
  4. The number of vowels together with the actual vowels from the input
  5. The number of consonants together with the actual consonants from the input
  6. The count of the numeric characters together with the actual numeric characters from the input
  7. The count of the special characters together with the actual special characters from the input

sample Input

october/15/1975

Sample Output

7:letters

6:numbers

2:special-characters

3:ooe

4:ctbr

6:151975

2://



LATEST TUTORIALS
APPROVED BY CLIENTS