6 like 0 dislike

Write a program that input two-digit number, then prints the number with its digits reversed.

Example input: 

54

Example output:

45

 

[Normal] Coding (C) - asked in Introduction to Computer Programming I (C) by (11.9k points)
Available when: Unlimited - Due to: Unlimited

retagged by | 59 views

3 Answers

0 like 0 dislike
Hidden content!
#include * * ** **

int main()
{
* * ***** *** ** * * num, temp, remainder, reverse = 0;
** * * * ** ** * *** **
*** * * ** ********** * ** * **** * * &num);
* **** *** *** = num;
** ** * *** ** * * * *** (num > 0)
* * * *** * * * ***
* ** ** *** * ** ** * **** **** ** *** ** ** ** ** * = num % 10;
* * ** ** * ******* ****** ****** * * ** * = reverse * 10 + remainder;
* *** ** *** * ** *** ** ** * * ** * * **** *** /= 10;
* ** * ** * **** * * ** *
** * * * * *** * *** * ****** ** ** * * * reverse);


* * * * *** ***** * 0;
}
answered by (323 points)
0 0
prog.c: In function 'main':
prog.c:5:14: error: variable 'temp' set but not used [-Werror=unused-but-set-variable]
     int num, temp, remainder, reverse = 0;
              ^~~~
cc1: all warnings being treated as errors
0 like 0 dislike
Hidden content!
#include ** * ***

int main()
{
* ***** *** ****** * num, temp, remainder, reverse = 0;
* ** * *** * *** * **
***** ** * * * * ** * ** *** ***** ***** ** ** ** ** * ***** ** &num);
**** ** * *** * * = num;
* * *** * ** * ** * ***** *** (num > 0)
* *** * * *** ** * * *
* * * * * **** *** ****** * * ** * ** * ** * = num % 10;
*** * * ** ** **** ***** ** * *** ** ** ** * = reverse * 10 + remainder;
*** * ** ** ** * * ** * ****** * ** *** /= 10;
** **** * ** * **** ****
* * * *** * * * ******* * * * ** *** * **** * reverse);
}
answered by (323 points)
0 0
prog.c: In function 'main':
prog.c:5:14: error: variable 'temp' set but not used [-Werror=unused-but-set-variable]
     int num, temp, remainder, reverse = 0;
              ^~~~
cc1: all warnings being treated as errors
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main()
{
    int a,b,c;
* * * * ** * **** *** * * ** ** ****
* ***** * ***** * ** * * * *** ** * * *
** * * **** * * * ** * * *
*** * ** * * ** ****
* ** *** * **
**** *** * ** *** ** * * * * ** * ** ** *
* * * **** ** **** * ** ** *** * ***
* ****** * * ** **** * * 0;
}
answered by (-254 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.78.228
©2016-2020

Related questions

6 like 0 dislike
1 answer
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (11.9k points)
Available when: Unlimited - Due to: Unlimited
| 54 views
10,943 questions
124,821 answers
118,847 comments
3,820 users