Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
write a program to read an integer and find its reverse. note: if user enter 1234 then the output should be 4321 in Python
Home
Education
write a program to read an integer and find its...
asked
Dec 2, 2021
in
Education
by
JackTerrance
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
computer-science-interview-questions
computer-science-questions
1
Answer
0
votes
answered
Dec 2, 2021
by
JackTerrance
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
Q: Tell the user to enter your name then read in and assign to a variable a string typed in by the user
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Tell the user to enter your name then read in and assign to a variable a string typed in by the user
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and print all palindrome words in the sentence present. Java class 10
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to prompt the user for days and rate per day to compute total pay. Use 50 days and a rate of 3.5 per day to test the program. Total pay is equal to (days* Rate per day). You should use input to read a string and float() to convert the string to a number.
Write a program to prompt the user for days and rate per day to compute total pay. Use 50 days and a rate ... the string to a number. Select the correct answer from above options...
asked
Dec 1, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program in python to enter the mark in 3 subjects and calculate total and assign grade. If total >= 200 grade is ‘A’ otherwise grade is ‘B’
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program in python to find the greatest of three no. given by user
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: create a four-function calculator. the program requires the user to enter two numbers and an operato
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: create a four-function calculator. the program requires the user to enter two numbers and an operato
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a menu-driven program to print the following patterns, where number of rowsfor the pattern should be the user input:a. Press 1 to print the following pattern:55 85 8 135 8 13 205 8 13 20 29b. Press 2 to print the following pattern:22 92 9 282 9 28 652 9 28 65 126c. Print the following series:
Write a menu-driven program to print the following patterns, where number of rows for the pattern should be the user ... 2 4 8 32 Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: WRITE A PROGRAM TO READ DETAILS LIKE NAME, CLASS , AGE OF A STUDENT AND THEN PRINT THE DETAILS FIRSTLY IN SAME LINE AND THEN IN SEPERATE LINES
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to accept a filename from the user and display all the lines from the file which contain python comment character ‘#’.
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a python program to print first n(entered by user) even natural numbers.
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: 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)
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to accept string from user and search a given character from string without using find() function
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to accept an integer numberbetween 1 and 9. Write the value of the number
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
computer-science-interview-questions
computer-science-questions
...