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".
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:
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
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:
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.