Write a console program that will output "multiplication tables" for the digits 1-10 multiplied by 1-10. Your output will look like this:
1 2 3 4 ...
2 4 6 8 ....
....
7 14 21 28 ....
etc.
This is best done with a loop inside a loop.
Include comments telling what each line does and who wrote the program and its purpose.
Since this is a console program I only need the .cs file. Be sure to include your name in the filename. I don't want 20 programs named mult1.cs.
to input a number and print all numbers from 30 to 60 that is divisible by the input number
#include <iostream>
using namespace std;
int *my_array;
int array_length;
void FunA(int pos, int input){
my_array[pos] = input;
}
int FunB(){
int n;
cout<<"enter lenth of the array: ";
cin>>n;
my_array = new int[n] ;
return n;
}
int main (){
array_length = FunB();
FunA(array_length-1,20);
delete [] my_array;
return 0;
}
a) Explain the code snippet above in details.
by CodeChum Admin
We've been dealing with integers too much, it's time for decimals to shine!
Instructions:
Input
A line containing five decimal numbers separated by a space.
1.1·1.2·1.3·1.4·1.1Output
The first line contains all the inputted decimal numbers separated by a space.
The second line contains a string which is the result.
1.1·1.2·1.3·1.4·1.1
Yesby CodeChum Admin
Well, that's odd, or is it? It's your job to find out!
Instructions:
Input
A line containing an integer
5Output
The first line contains the inputted integer.
The second line contains a string which is the result.
5
Oddby CodeChum Admin
Do you believe in doppelgangers? Well they are very much possible with strings! Check if the two given strings are the same or not.
Instructions:
Input
Two lines containing a string on each.
hello
helloOutput
The first line contains the two inputted strings separated by a \.
The second line contains a string result.
hello\hello
Equalby CodeChum Admin
They say that the one in first place is always greater than the one in the second and third place. Are they always right?
Instructions:
Input
Three lines containing an integer on each.
3
2
1Output
The first line contains all the three inputted integers.
The second line contains a string which is the result.
3·2·1
Yesby CodeChum Admin
It's time to find out if something is true or false. Let's test your capabilities by creating a program that checks if two integers are equal!
Instructions:
Input
A line containing two integers separated by a space.
5·5Output
The first line contains the two integers input.
The second line contains a string which is the result.
5·5
EqualThe Richest Person
You are given a N entries denoting incomes of people.Same person can have more than one income entry.Write a Program to print person's name and index of the first income entry of the person with highest total income.In case of tie in total income, choose the lexicographically smallest name.
Note:
Name will contain only alphabets and spaces.
Names are case insensitive (i,e Ravi and ravi are same).
Ignore spaces in the name while comparing (i,e Ravi Kishore and RaviKishore are same).
Input
The first line contains an integer N.
Each of next N lines contains the name and income entry of a person.
Sample input1
4
John Cena 1000
John 2000
Jack 4000
Tom 4000
sample output1
Jack 2
]
Swap Letters
Anil is given a sentense S.He tries to make this sentence special.A sentence can be made special by swapping the character with the highest frequency with the character having the lowest frequency in the sentence.Help Anil by transforming the sentence into a special Sentence.
Note:
Consider Upper and lower case letters as different.
If there are multiple letters with the same frequency, choose the lower case letter that comes earliest in dictionary order.
a.If letters like x and B have the same frequency consider x.
b.If letters like x and b have the same frequency consider b.
Input
The first line of input is a string.
sample input1
Python is a programming language.
sample output1
Python is e progremming lenguega.
sample input2
CHECK your blood PRESSURE frequently.
sample output2
CHECK ybur olbbd PRESSURE frequently.