Tech Number| Number Pattern| | While Loop | Lecture #62 #cprogramming #coding #whileloop #c

preview_player
Показать описание
A number is called a tech number if the given number has an even number of digits, and the number can be divided exactly into two parts from the middle. After equally dividing the number, sum up the numbers and find the square of the sum. If we get the number itself as square, the given number is a tech number, else, not a tech number. For example, 2025 is a tech number.
The base condition to check the tech number is that the number must contain an even number of digits. If so, we will move to the next step, else will not execute the code further. Let's see the steps.
Read or initialize a number (num).
Find the number of digits of the given number (num).
If the number of digits is not even, the number (num) is not even.
Else, split the given number into two parts (num1 and num2), equally. Note that each part must contain an equal number of digits.
Sum up the numbers (num1+num2) and store the result in a variable
Find the square of the variable sum and store it in a variable square.
Compare the num with the square of the sum if they are equal print Tech Number, else print Not a Tech Number.
#coding #cprogramming #beginners #beginnercoder #logical #tech #technumber #numbers #patterns #369 #hindi #whileloop #loopingstatement #iteration #bca #btech #placement #c
Рекомендации по теме
visit shbcf.ru