logo

Crowdly

COM 103: Programming Languages I (C++)

Looking for COM 103: Programming Languages I (C++) test answers and solutions? Browse our comprehensive collection of verified answers for COM 103: Programming Languages I (C++) at ocs-alatoo.edu.kg.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Write a program in C++ to print a square pattern with the # character.

Declare and use void draw_pattern(int n) function which draws a square with # character.

Sample Output:

Print a pattern like square with # character:

Input the number of characters for a side: 4

# # # #

# # # #

# # # #

# # # #

View this question

Write a C++ program to check which number is closest to the value 100 among two given integers. Return 0 if the two numbers are in equal distance.

Sample output:

78, 95 => 95

95, 95 => 0

105, 95 => 0

95, 115 => 95

View this question

Write a program in C++ to find the sum of the first n natural numbers. n is given from input. Print result as given in sample.

Use for loop to solve this task.

Sample output:

10

1+2+3+4+5+6+7+8+9+10=55

View this question

Write a program in C++ to find the sum of the first and last digits of a number.

Use while loop to solve this task.

Sample Output:

Input any number: 12345

The first digit of 12345 is: 1

The last digit of 12345 is: 5

The sum of first and last digit of 12345 is: 6

View this question

Write a C++ program that inputs one side of cube and calculates the volume of a cube.

View this question

Want instant access to all verified answers on ocs-alatoo.edu.kg?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!