1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
guajiro [1.7K]
2 years ago
15

B. WAP to check whether input number is palindrome number or not using SUB...... END SUB.​

Computers and Technology
1 answer:
sveticcg [70]2 years ago
3 0

For a number to be palindrome, the reverse of the number and the original number must be the same.

<h3>The main program</h3>

The program written in Python, where comments are used to explain each line is as follows:

#This gets input for the number

num = input()

#This reverses the number

numrev = num[::-1]

#If the reverse and the original number is the same

if num == numrev:

   #This prints Palindrome

   print("Palindrome")

else:

   #Otherwise, it prints Not palindrome

   print("Not palindrome")

Read more about Python programs at:

brainly.com/question/26497128

You might be interested in
How would you copy all files from a remote directory into your LOCAL home folder.
11111nata11111 [884]

Answer: Using secure copy 'SCP' we can copy all files from a remote directory into local folder. It also replaces existing files.

Explanation:

This is illustrated as follows:

scp -r [email protected]:/path/to/server/source/folder/  .

-r is recursively copy all files

username is your username in your system

IP, here you cab specify the IP or type the website such as www.google.com

Then we specify the path, complete path

"." dot here refers the current directory. To copy the contents in the current directory.

5 0
3 years ago
Types of Computer games​
kiruha [24]

\bold{Hello}~

\bold{Answer:}

<h3>Types of Computer games</h3>
  • Action
  • Adventure
  • Simulation
  • Sports
  • Role-playing
  • Puzzlers
  • Party games

<em>(</em><em>That's</em><em> </em><em>all</em><em> </em><em>i</em><em> </em><em>know</em><em>)</em><em> </em>

<h2>#Hopeithelps\:</h2>

\bold{-Kei}~

\tiny\sf\purple{ ♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡ }

5 0
2 years ago
Write a method swaparrayends() that swaps the first and last elements of its array parameter. ex: sortarray = {10, 20, 30, 40} b
Alexus [3.1K]
In the C programming language, you can't determine the array size from the parameter, so you have to pass it in as an extra parameter. The solution could be:

#include <stdio.h>

void swaparrayends(int arr[], int nrElements)
{
int temp = arr[0];
arr[0] = arr[nrElements - 1];
arr[nrElements - 1] = temp;
}


void main()
{
int i;
int myArray[] = { 1,2,3,4,5 };
int nrElements = sizeof(myArray) / sizeof(myArray[0]);
swaparrayends(myArray, nrElements);

for (i = 0; i < nrElements; i++)
{
printf("%d ", myArray[i]);
}

getchar();
}

In higher languages like C# it becomes much simpler:

        static void Main(string[] args)
        {
            int[] myArray = {1, 2, 3, 4, 5};
            swaparrayends(myArray);
            foreach (var el in myArray)
            {
                Console.Write(el + " ");
            }

            Console.ReadLine();
        }

        static void swaparrayends(int[] arr)
        {
            int temp = arr[0];
            arr[0] = arr.Last();
            arr[arr.Length - 1] = temp;
        }

3 0
3 years ago
It can be hard to get close enough to photograph animals in the wild true or false
marysya [2.9K]

Answer:

True

Explanation:

8 0
3 years ago
Read 2 more answers
8.11 LAB: Count characters - functions Write a program whose input is a character and a string, and whose output indicates the n
Shkiper50 [21]

Answer:

#include<iostream>

using namespace std;

int CountCharacters(char userChar, const string inputstr){

   int k = 0;

   int iter = 0;

   for (iter = 0; iter < inputstr.size(); iter++){

       if (inputstr[iter] ==  userChar){

           ++k;        }}

   return k;}

int main(){

   string str;

   char userChar[1];

   cout<<"Char: ";    cin>>userChar;

   cin.ignore();

   cout<<"String: ";   getline(cin, str);

   cout<<CountCharacters(userChar[0],str);

   return 0;}

Explanation:

Written in C++:

The function is defined here:

int CountCharacters(char userChar, const string inputstr){

This initializes a count variable k to 0

   int k = 0;

This initializes an iterating variable iter to 0

   int iter = 0;

This iterates through the characters of the string being passed to the function

   for (iter = 0; iter < inputstr.size(); iter++){

This checks for matching characters

       if (inputstr[iter] ==  userChar){

If found,  k is incremented by 1

           ++k;        }}

This returns the total count

   return k;}

The main begins here

int main(){

This declares a string variable

   string str;

This declares a character variable

   char userChar[1];

This gets input for the character variable

   cout<<"Char: ";    cin>>userChar;

This lets the user get another input

   cin.ignore();

This gets input for the string variable

   cout<<"String: ";   getline(cin, str);

This calls the function and return the count of character in the string

   cout<<CountCharacters(userChar[0],str);

6 0
3 years ago
Other questions:
  • Exterior brick veneers are used to support the entire weight of the roof structure
    12·2 answers
  • All of the following are search operators EXCEPT _______________. a. AND b. OR c. NOT d. GET
    12·2 answers
  • If Denise specifies Jan? as a search criterion, Excel will locate all of the following records EXCEPT ____.
    9·1 answer
  • In this exercise, use the following variables : i,lo, hi, and result. Assume that lo and hi each are associated with an int and
    9·1 answer
  • When was internet started in which year​
    13·2 answers
  • int temp; temp = 180; if ( temp &gt; 90 ) { System.out.println( "This porridge is too hot." ); // cool down temp = temp – ( temp
    9·1 answer
  • How was the addition of an improvement over early web design?
    11·1 answer
  • Meaning of ‘integrity of data’
    14·2 answers
  • Imagine that you wanted to write a program that asks the user to enter in 5 grade values. The user may or may not enter valid gr
    10·1 answer
  • Assessment
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!