LabVIEW- To Check Number is Palindrome or Not
Hi Friends,
Today we will make a program to check that the number is palindrome or not.Palindrome number means which can be reads the same backwards and forwards.
example-515,23432,98789 etc.
I hope that you know the basics of LabVIEW so that it will be little easy to start.If not, then don't worry, read another articles to learn basics from this blog.
Step-2. Right click on the empty Front panel to open the control palette.Click on the modern and then numeric.Now we want to provide input number in the program so chose the numeric control.
If we want to display the numeric number then we need to chose the Number Indicator. Right now we don't required to display the number.
To Show that the input number is Palindrome or not, we will add one LED also in the program.This is done by From the Control Palette-->Modem-->Boolean-->Round LED.
Step-3. Now Click on the window tab in the front panel window and click on the show Block Diagram.
Ctrl+E is used to switch between the Front Panel Window and Block Diagram Window.
Step-4.We can see that the Numeric icon and LED appear on the block diagram window which we put in the Front Panel window.Right click on the Block Diagram window and open the functions palette.
Step-5. Now we first convert our input numeric number to the string.This can be done by-
From Functions palette click on the Programming-->String-->Number/String Conversion-->Number to Decimal String.
Steps-6.After converting the number to string we will reverse the string by the following functions.
From the functions palette click on the Programming-->String-->Additional String Functions-->Reverse string.
Steps-7. After doing reverse of the string, we can compare the original input string to the reverse string.If both are equal then we can say that the number is palindrome.
For selecting the equal function ,From Functions palette click on the Programming-->comparison-->Equal.
Steps-8. Arrange all the functions as below image.
If the Number is Palindrome then the LED will turn ON otherwise it will turn OFF.
Today we will make a program to check that the number is palindrome or not.Palindrome number means which can be reads the same backwards and forwards.
example-515,23432,98789 etc.
I hope that you know the basics of LabVIEW so that it will be little easy to start.If not, then don't worry, read another articles to learn basics from this blog.
How to check Input Number is Palindrome or not ?
Step-1. Open the Front Panel of the new program.Step-2. Right click on the empty Front panel to open the control palette.Click on the modern and then numeric.Now we want to provide input number in the program so chose the numeric control.
If we want to display the numeric number then we need to chose the Number Indicator. Right now we don't required to display the number.
To Show that the input number is Palindrome or not, we will add one LED also in the program.This is done by From the Control Palette-->Modem-->Boolean-->Round LED.
Step-3. Now Click on the window tab in the front panel window and click on the show Block Diagram.
Ctrl+E is used to switch between the Front Panel Window and Block Diagram Window.
Step-4.We can see that the Numeric icon and LED appear on the block diagram window which we put in the Front Panel window.Right click on the Block Diagram window and open the functions palette.
Step-5. Now we first convert our input numeric number to the string.This can be done by-
From Functions palette click on the Programming-->String-->Number/String Conversion-->Number to Decimal String.
Steps-6.After converting the number to string we will reverse the string by the following functions.
From the functions palette click on the Programming-->String-->Additional String Functions-->Reverse string.
Steps-7. After doing reverse of the string, we can compare the original input string to the reverse string.If both are equal then we can say that the number is palindrome.
For selecting the equal function ,From Functions palette click on the Programming-->comparison-->Equal.
Steps-8. Arrange all the functions as below image.
If the Number is Palindrome then the LED will turn ON otherwise it will turn OFF.
Comments
Post a Comment