in Education by
write a program to read an integer and find its reverse. note: if user enter 1234 then the output should be 4321 in Python Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Main part is here : n=sc.nextInt(); int p,rev=0; while(n>0) { p=n%10; rev=rev*10+p; n=n/10; } System.out.print(“Reverse :”+rev);

Related questions

0 votes
    Tell the user to enter your name then read in and assign to a variable a string typed in by the user Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    Tell the user to enter your name then read in and assign to a variable a string typed in by the user Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a program in python to enter the mark in 3 subjects and calculate total and assign grade. If total >= 200 ... grade is B' Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    write a program in python to find the greatest of three no. given by user Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    create a four-function calculator. the program requires the user to enter two numbers and an operator. it then ... displays the result Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    create a four-function calculator. the program requires the user to enter two numbers and an operator. it then ... displays the result Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    WRITE A PROGRAM TO READ DETAILS LIKE NAME, CLASS , AGE OF A STUDENT AND THEN PRINT THE DETAILS FIRSTLY IN ... THEN IN SEPERATE LINES Select the correct answer from above options...
asked Dec 30, 2021 in Education by JackTerrance
0 votes
    Write a program to accept a filename from the user and display all the lines from the file which contain python comment character ‘#’. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Write a python program to print first n(entered by user) even natural numbers. Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Write a program in python to insert ten friends name in a list, then print 3rd, 5th and 9th value from the list (using data structure) Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    Write a program to accept string from user and search a given character from string without using find() function Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    Write a C program to accept an integer number between 1 and 9. Write the value of the number in words. Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
...