Problem: Lex program to check whether given number is armstrong number or not.
Lex is a computer program that generates lexical analyzers and was written by Mike Lesk and Eric Schmidt. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language.
An Armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number,
(1^3) + (5^3) + (3^3) = 153
Input: 153 Output: 153 is a Armstrong number Input: 250 Output: 250 is not a Armstrong number
- Lex program to check whether a given number is even or odd
- Lex program to check whether input number is odd or even
- Lex Program to check whether a number is Prime or Not
- Lex program to check valid Mobile Number
- Lex Program to count number of words
- LEX program to count the number of vowels and consonants in a given string
- Lex program to count the number of lines, spaces and tabs
- DFA in LEX code which accepts even number of zeros and even number of ones
- DFA in LEX code which accepts Odd number of 0’s and even number of 1’s
- Lex program to check whether given string is Palindrome or Not
- Lex Program to check valid email
- Lex program to check perfect numbers
- Lex program to check if a Date is valid or not
- C program to check syntax of 'for' loop
- Lex program to check whether the input is digit or not
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.