6 like 0 dislike
1.2k views

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 (12.1k points)
ID: 27167 - Available when: Unlimited - Due to: Unlimited

retagged by | 1.2k 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
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.80.170
©2016-2025

Related questions

6 like 0 dislike
1 answer
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (12.1k points)
ID: 27170 - Available when: Unlimited - Due to: Unlimited
| 949 views
12,783 questions
183,442 answers
172,219 comments
4,824 users