Questions: 1 978

Answers by our Experts: 1 850

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 to input 2 numbers and print sum, subtraction, multiplication, division and modulus of those numbers.





Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.

Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".


What's in There?

Let's try defining the size of the array and create the contents of it on our own! And then, to give off a sense of excitement, let's try accessing the value of an array element in a random index position!


Let's do this fast!


Instructions:

  1. Create an empty character array with a size of 100.
  2. Use an appropriate input function for strings and store the value into the empty array.
  3. Input a random integer. It shall only be any integer that's less than the string's length.
  4. Using your understanding on accessing list elements, access and print out the array element having the index position of the inputted random integer

Input


1. A string

2. An index

Output

The first line will contain a message prompt to input the string.

The second line will contain a message prompt to input the integer which represents the index.

The last line contains the character at the index.

Enter·the·string:·Cody
Enter·the·index:·3
Character·at·index·3·=·y

Cubes and Squares


You can also make a list of numbers, ey? Let's go and have some fun in tweaking the values of each element, but let's give it some twist to add on some fun to the code.


Let's have a go at it!


Instructions:

  1. An array containing 40 integer elements is already provided for you in the code editor below.
  2. Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.

Output

The squares and cubes of the elements in the array.

4
1
1
8
27
.
.
.

Read 10 integers from the keyboard in the range 0 -100, and count how many of them are larger than 50, and display this result.


Write a C program that does the following: a. Declare a structure called Car with the following members: Price (float), Year (int), Color (String) and Brand (String). b. Ask the user to enter the information of 10 cars and save them in an array called CARS. c. Print the color of the car(s) that has (have) a price greater than 15000. d. Write a function called oldestCar that takes the array CARS as an argument and returns the oldest car among all cars. e. In the main, call the function oldestCar and print all information of the oldest car.


Consider a square matrix A of size Nx N and an integer X which is an element of A. Find the row number R and column number C of X in A, and calculate the sum of


Write a program to print the number of leap years in the given list of years.



Write a program to print the number of leap years in the given list of years.



Input:



First line of input is total number of years (n)



Next n lines will be the years.

Find latitude and longitude of utmost 20 countries, ordered by population, with a population greater or equal to the population limit given below and have atleast one currency exclusively for themselves. (countries like Madagascar, Sri Lanka but not India, USA). Use the country details from this dataset.

Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.

  • Assume radius of earth: 6371 km
  • Round length of each line and final result to 2 decimal points
  • If co-ordinates are missing for any country use 0.000 N 0.000 E
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS