+ 5
C program Challenge! Square of Digits.
Write a C program to do the following: It ask user to enter a numeric value. Then your program should square the each digit and concatenate it and stores into another variable. Then it prints the result variable. Eg: input : 123 output : 149 input : 1529 output: 125481 Conditions: Use only stdio.h and conio.h Use only primitive integer data type. use least number of variable. _________________________________________ Hope you understand the challenge. Happy Coding.
11 Respostas
+ 3
https://code.sololearn.com/c4IalkP9ZRf2/?ref=app
Only 14 line code and work same!đ
+ 4
My try (C++).
https://code.sololearn.com/ciR81s0lK6iP/?ref=app
+ 3
https://code.sololearn.com/cU5WAxUpqf8s/?ref=app
+ 2
https://code.sololearn.com/cP0azBqVf13G/?ref=app
Here is mine code.đ
+ 2
https://code.sololearn.com/cMN3NrvndBvp/?ref=app
here is my try đ
+ 1
@HaRjit SiNgh, Cool code. You used too much variables, but you can reduce the variable declaration also.
works like charm.
+ 1
@Med Arezki Jr.
Nice try, but your code is valid for 3 digits only.
Make some changes to work perfectly.
Happy coding
+ 1
https://www.sololearn.com/discuss/967375/?ref=app
Find Error in this code.
0
your output comes in reverse plz beg me ..
https://code.sololearn.com/ci5YBkJBBmtT/?ref=app
0
@Yesh Jadav, you are printing each squared digits one by one, but challenge is to store all squared digit into one single variable and then finally print that variable value.
Make some changes.
btw, nice effort