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

retagged by | 79 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.79.199
©2016-2021

Related questions

6 like 0 dislike
1 answer
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (12k points)
Available when: Unlimited - Due to: Unlimited
| 74 views
11,185 questions
132,648 answers
131,374 comments
4,050 users