{"id":48064,"date":"2024-04-26T17:51:00","date_gmt":"2024-04-26T12:21:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/"},"modified":"2024-09-03T11:08:06","modified_gmt":"2024-09-03T05:38:06","slug":"armstrong-number-in-c","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/","title":{"rendered":"Armstrong Number in C"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-is-armstrong-number-in-c\"><strong>What is Armstrong Number in C?<\/strong><\/h2>\n\n\n\n<p>An Armstrong number (also known as a narcissistic number, plenary number, or pluperfect number) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n1^3 + 5^3 + 3^3 = 153.\n<\/pre><\/div>\n\n\n<p>It's named after Michael F. Armstrong, who used it as an example in a programming problem in 1969. These numbers are intriguing in mathematics and programming because they are relatively rare and often used in exercises to test programming skills.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"armstrong-number-example\">Armstrong Number Example<\/h2>\n\n\n\n<p>If the Armstrong number is a positive integer of order n then it can be defined as,<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\nabcde\u2026. = pow (a, n) + pow (b, n) + pow (c, n) + pow (d, n) + pow (e, n) + \u2026\u2026\u2026\n\nFor example : 0, 1, 153, 370, 371, 1634 etc.\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"lets-check-whether-370-is-an-armstrong-number-or-not\">Let\u2019s check whether 370 is an Armstrong number or not<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n370 = (3 * 3 * 3) + (7 * 7 * 7) + (0 * 0 * 0)\n\nHere,\u00a0\u00a0\u00a0\u00a0\n\n(3 * 3 * 3) = 27\n\n(7 * 7 * 7) = 343\n\n(0 * 0 * 0) = 0\n\n27 + 343 + 0 = 370, which is equal to the given number; hence it is an Armstrong number.\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"lets-check-four-digits-armstrong-number\"><strong>Let\u2019s check four digits Armstrong number:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n1634 = (1 * 1 * 1 * 1) + (6 * 6 * 6 * 6) + (3 * 3 * 3 * 3) + (4 * 4 * 4 * 4)\n\nHere,\u00a0\n\n(1 * 1 * 1 * 1) = 1\n\n(6 * 6* 6 * 6) = 1296\n\n(3 * 3 * 3 * 3) = 81\n\n(4 * 4 * 4 * 4) = 256\n\n1 + 1296 + 81 + 256 = 1634, which is equal to the given number; hence it is an Armstrong number.\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"algorithm-of-armstrong-number-in-c\"><strong>Algorithm of Armstrong Number in C<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Take input from the user<\/li>\n\n\n\n<li>Initialize sum = 0 and take temporary variable to temporarily store user input (var = num)<\/li>\n\n\n\n<li>Now find out the total number of digits in the given number<\/li>\n\n\n\n<li>Total number of digits get stored in a<\/li>\n\n\n\n<li>Repeat the loop till var &gt; 0<\/li>\n\n\n\n<li>Store the output of while loop in sum<\/li>\n\n\n\n<li>Check whether the user number is equal to sum or not<\/li>\n\n\n\n<li>If it is equal than print \u201cIt is an Armstrong number\u201d<\/li>\n\n\n\n<li>Else print \u201cIt is not an Armstrong number\u201d<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"program-of-armstrong-number-in-c\"><strong>Program of Armstrong Number in C<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;stdio.h&gt;\n#include &lt;conio.h&gt;\n \nint main ()\n{\nint num, var, rem, sum = 0, a = 0 ;\n \nprintf ( \u201c Please enter an integer: \u201c );  \/\/ Taking the user input\nscanf ( \u201c%d\u201d, &amp;num );\n \nvar = num;\n \nwhile (var != 0)\t\/\/ Finding the numbers of digits in a given number\n{\nvar = var \/ 10;\n++a;\n}\n \nvar = num;\n \nwhile (var &gt; 0 )  \t\/\/ Calculate the number to check  it is Armstrong or not\n{\nrem = var % 10;\nsum = sum +  pow( rem, a );\nvar = var \/ 10;\n}\n \nif ( sum == num )\t\/\/ Check whether the sum is equal to the given number of not\n{\nprintf ( \u201c %d is an Armstrong number n \u201d, num );\n}\nelse\n{\nprintf ( \u201c %d is not an Armstrong number n \u201d, num );\n}\nreturn 0;\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"output-1\"><strong>Output 1:<\/strong><\/h3>\n\n\n\n<p>Please enter an integer: 371<\/p>\n\n\n\n<p>371 is an Armstrong number<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"output-2\"><strong>Output 2:<\/strong><\/h3>\n\n\n\n<p>Please enter an integer: 1045<\/p>\n\n\n\n<p>1045 is an Armstrong number<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"explanation\"><strong>Explanation<\/strong><\/h2>\n\n\n\n<p>In the above code, we have first declared all the variables that are needed in the program. The num is declared to hold the user input. The var is used for the temporary storage, and then rem is used to hold the remainder that is required for calculation. At last, we have the sum and a, which are assigned to zero.<\/p>\n\n\n\n<p>We are accepting user input and then assigning that number to num. Then we assign this number to var so that we can make our calculation and keep the user input safe in the num variable.&nbsp;<\/p>\n\n\n\n<p>Now we are calculating the number of digits that user input has. For that, we have assigned num value to var, and we have taken a while loop. The while loop will be running until (var !=0) and then divide var by ten so that we can count the total number of digits in that number. Since var is of integer type, it will not store a decimal number, and then each time, the value of an increases by 1. This process is repeated until var is equal to zero. After that, it exits the loop.<\/p>\n\n\n\n<p>Now again, we assign num value to var. Then we start the loop, and this loop will run till var is greater than zero. We have three steps to perform inside the loop. First, we find the remainder of the number, and then we calculate the power of the remainder using pow(rem, a), where rem represents the remainder, and a represents the power, i.e., total number of digits in a number, which was calculated above. Now we divide the var by 10, and this is done because we don\u2019t require the last digit of the number because we have already used it. Since var is an integer type, it neglects the decimal value and stores the integer value. This process is repeated till var is greater than zero; after that, it exits from the loop, and the final value is stored in sum.<\/p>\n\n\n\n<p>Once the control moves out of the loop, the if statement checks whether sum is equal to the num or not, where the num is the input given by the user. If the sum is equal to num, then it is an Armstrong number. Else it is not an Armstrong number.<\/p>\n\n\n\n<p>So, here is all about \u201cArmstrong Number in C.\u201d We hope you find this implementation informative. Stay tuned for more upcoming blogs. Take up the <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/c-for-beginners1\" target=\"_blank\" rel=\"noreferrer noopener\">Free Online C Programming for Beginners Course<\/a> and learn more such concepts! For a deeper understanding of C programming, consider enrolling in our Pro course to Learn C Programming from Scratch, where you'll learn everything from C syntax to advanced topics like pointers, memory management, and modular programming<\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy PRO<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/learn-c-programming-from-scratch\" class=\"courses-cta-title-link\">C Programming Course: Master C with Hands-on Projects<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Join our C Programming Course and learn C syntax, operators, expressions, control flow, functions, pointers, structures, file handling, memory management, and modular programming. Build real-world skills through practical projects!<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>2 Projects<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>10 Hrs<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/learn-c-programming-from-scratch\" class=\"courses-cta-button\">\n                C Programming Course with Certificate\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Armstrong Number in C? An Armstrong number (also known as a narcissistic number, plenary number, or pluperfect number) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because: It's named after Michael [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":48074,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36889],"content_type":[36248],"class_list":["post-48064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-c-programming-2","content_type-career-guide"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Armstrong Number in C : Examples and Programs<\/title>\n<meta name=\"description\" content=\"A number is called Armstrong number in C when the sum of the nth power of each digit is equal to the given number. Learn more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Armstrong Number in C\" \/>\n<meta property=\"og:description\" content=\"A number is called Armstrong number in C when the sum of the nth power of each digit is equal to the given number. Learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-26T12:21:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-03T05:38:06+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1210\" \/>\n\t<meta property=\"og:image:height\" content=\"867\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Armstrong Number in C\",\"datePublished\":\"2024-04-26T12:21:00+00:00\",\"dateModified\":\"2024-09-03T05:38:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/\"},\"wordCount\":710,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/iStock-513393957.jpg\",\"keywords\":[\"C Programming\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/\",\"name\":\"Armstrong Number in C : Examples and Programs\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/iStock-513393957.jpg\",\"datePublished\":\"2024-04-26T12:21:00+00:00\",\"dateModified\":\"2024-09-03T05:38:06+00:00\",\"description\":\"A number is called Armstrong number in C when the sum of the nth power of each digit is equal to the given number. Learn more.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/iStock-513393957.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/iStock-513393957.jpg\",\"width\":1210,\"height\":867,\"caption\":\"Armstrong Number in C\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/armstrong-number-in-c\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Armstrong Number in C\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Armstrong Number in C : Examples and Programs","description":"A number is called Armstrong number in C when the sum of the nth power of each digit is equal to the given number. Learn more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Armstrong Number in C","og_description":"A number is called Armstrong number in C when the sum of the nth power of each digit is equal to the given number. Learn more.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2024-04-26T12:21:00+00:00","article_modified_time":"2024-09-03T05:38:06+00:00","og_image":[{"width":1210,"height":867,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Armstrong Number in C","datePublished":"2024-04-26T12:21:00+00:00","dateModified":"2024-09-03T05:38:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/"},"wordCount":710,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg","keywords":["C Programming"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/","url":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/","name":"Armstrong Number in C : Examples and Programs","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg","datePublished":"2024-04-26T12:21:00+00:00","dateModified":"2024-09-03T05:38:06+00:00","description":"A number is called Armstrong number in C when the sum of the nth power of each digit is equal to the given number. Learn more.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg","width":1210,"height":867,"caption":"Armstrong Number in C"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Armstrong Number in C"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg",1210,867,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-300x215.jpg",300,215,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-768x550.jpg",768,550,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-1024x734.jpg",1024,734,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg",1210,867,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957.jpg",1210,867,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-640x853.jpg",640,853,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-96x96.jpg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/10\/iStock-513393957-150x107.jpg",150,107,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"What is Armstrong Number in C? An Armstrong number (also known as a narcissistic number, plenary number, or pluperfect number) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because: It's named after Michael&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/48064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=48064"}],"version-history":[{"count":10,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/48064\/revisions"}],"predecessor-version":[{"id":111473,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/48064\/revisions\/111473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/48074"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=48064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=48064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=48064"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=48064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}