Search
 
SCRIPT & CODE EXAMPLE
 

C

write a program in c to check whether the number is armstrong or not

#include<stdio.h>
#include<conio.h>
void arm(int a);
int main()
{
	int a;
	printf("			Enter a number
			 ");
	scanf("%d",&a);
	arm (a);
	getch();
	return 0;
}
void arm(int a)
{
	int b,sum,remainder;
	b=a;
	while (a>0)
	{
		remainder=a%10;
		sum=sum+(remainder*remainder*remainder);
		a=(a-remainder)/10;
	}
	if (b==sum)
	{
		printf("	
It is armstrong number
");
	}
	else
	{
		printf("
	It is not armstrong number
");
	}
}
Comment

PREVIOUS NEXT
Code Example
C :: array loop in c 
C :: how to get add to number C 
C :: que es % en c 
C :: srand time null 
C :: exclamation mark in c 
C :: c programming itoa() example 
C :: c convert number to string 
C :: c define array size 
C :: how to create calculator with switch in c 
C :: differnce between spooling and buffering 
C :: pg_restore: error: input file appears to be a text format dump. Please use psql. 
C :: arduino uno spi pins 
C :: how to modulo in c without use the operator 
C :: bitwise operators in c 
C :: Gemfile.lock`. It is likely that you need to grant write permissions for that path. 
C :: comment in c language 
C :: prime number c program 
C :: Grepper VSCode Add On 
C :: c convert float to string 
C :: flip exis in dataframe 
C :: quick sort c 
C :: convert string to int error checking c 
C :: Leap year using function in c 
C :: ecrire programme en C une fonction remplir tableau et un fonction inverser 
C :: mediawiki upload size 
C :: how to check the word is present in given char array in c 
C :: c command line arguments parser 
C :: mc dropout pytorch 
C :: create syscall 
C :: fifo page algorithm in C 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =