/New_Learners_C-plus_plus_programming_Questions

Just complete the given template or find the bug in the program so that the program is right.

Primary LanguageC++

New_Learners_C-plus_plus_programming

Some Problems for the beginners in C++

Answer submission procedure

  • Create an issue (if want to solve Problem 1 then create an issue as Problem 1 solution) then get assigned by admin (first come first service) and then start solving it
  • If question asks for Bug or the what does the program do then edit the readme file and specify the bug like: "### Problem "number" "newline" - Bug1/output "text" "newline" -Bug2/output "text"...."
  • If question asks for Bug and correct it, first specify the bug and submit the corrected file name as "Problem number_sol"
  • If solving issues then answer in readme file using the discussed convention and then upload the file(if asked)

Example How to specify?

Problem 1

  • Bug 1/output
  • Bug 2/output
  • .
  • .
  • Bug n/output
  • Then upload the file if necessary

OR

Problem 1

  • Issue number- answer
  • Then upload the file if necessary

Answers

Problem 6

  • Issue number-13

output will be

Enter number of rows: 5

1

2 3

4 5 6

7 8 9 10

11 12 13 14 15

output is called-Pascal's Triangle.

Issue 2

Checking equality without using comparison or arithmetic operator:

  • using bitwise XOR

Problem 10

  • Rotates the array circular right

Problem 8

  • This program calculates the sum of digits till a single digit is obtained, for ex:

    534=> 5+3+4=12

    12=> 1+2=3.

    So output would be 3.

Problem 2

  • Bug 1 => variable 'Test' is not decremented due to which infinite while loop
  • Bug 2 => no input for variable 'a' so garbage value is printed

Problem 4

  • It is a simple program that swaps the values of 2 variables in a single line.