Write a C program to perform the arithmetic operation. Here, the preprocessor replaces "printf" in place of "out" and "scant" in place of "in" before compilation of program. Therefore, the word can be defined as macro. Note** #define out printf** #define in scanf.
Input:
6.5
3.3
Output:
9.8
Diamond
Given an integer value
N, write a program to print a number diamond of 2*N -1 rows as shown below.
Input
The first line of input is an integer
N.
Explanation
In the given example, the number of rows in the diamond is
5.
So, the output should be
. . . . 0 . . . .
. . . 0 0 0 . . .
. . 0 0 0 0 0 . .
. 0 0 0 0 0 0 0 .
0 0 0 0 0 0 0 0 0
. 0 0 0 0 0 0 0 .
. . 0 0 0 0 0 . .
. . . 0 0 0 . . .
. . . . 0 . . . .
Sample Input 1
5
Sample Output 1
. . . . 0 . . . .
. . . 0 0 0 . . .
. . 0 0 0 0 0 . .
. 0 0 0 0 0 0 0 .
0 0 0 0 0 0 0 0 0
. 0 0 0 0 0 0 0 .
. . 0 0 0 0 0 . .
. . . 0 0 0 . . .
. . . . 0 . . . .
Sample Input 2
4
Sample Output 2
. . . 0 . . .
. . 0 0 0 . .
. 0 0 0 0 0 .
0 0 0 0 0 0 0
. 0 0 0 0 0 .
. . 0 0 0 . .
. . . 0 . .
A college has to generate the roll number of the students for the internal examination. The college admin authority has to generate the roll numbers from the registration number of the students. Every student has a registration number. The registration number is a numeric number. The authority has devised a method for generating the roll numbers from the registration number. To generate the roll number, the pairs of adjacent digits are formed from the start of the roll number. From each pair the lexicograpically smallest digit will be removed. If a digit will be left unpaired then that digit will be taken as it is in the roll number.
Write an algorithm for implementing the devised method for the college system to find the roll number from the registration number.
What the code in python
Write a c++ program for the World Bowling Competition. An input file, score.txt, contains the name of each player, the name of the player's team and each player's individual score. There will only be two teams(Blue and White). Read the data from the input file into three parallel arrays.The program must accumulate the total score for each team and then output the name of the winning team and the player's names and score of the winning team. Assume there is no chance of a tie. Use functions to:
1) Read the data from the input file into parallel arrays,
2) Determine the winning team,
3) Display the winning team's player names and scores
Faizan and Hamza are brothers. In three years, Hamza will be five years younger than two time’s Faizan’s current age. Write a Java program to calculate and display Hamza’s age
Swati bought 600 shares of stock at a price of Rs 20 per share. She must pay her stock broker a 2% commission for the transaction.
Write a program that the display the following:
-The amount paid for the stock alone (without the commission)
-The amount of the commission
-The total amount paid
A method called sine, which takes as its only parameter a value of type double, and returns a value
of type double. The parameter represents an angle expressed in radians, and the value returned by
the method represents the trigonometric sine of this angle. For example, suppose the following method
call is executed:
Find perimeter of a matrix without using numpy
Input1:
1 2 3
4 5 6
7 8 9
Output: 40
Input2:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output: 102
Write a python program that prints a rectangle of size M (height/line numbers) and N (length/column numbers) using incrementing numbers where M and N will be given as input. Please look at the examples below for clarification.
Hint: You may need to use nested loops and print the loop counter variable in one of the loops.
==========================================================
Sample Input 1:
4
6
Sample Output 1:
123456
123456
123456
123456