Skip to main content

Featured

C Program to display spellings of number 1-10 on entry

C Program to display spellings of number 1-10 on entry.   #include<stdio.h>   void main() { int num; printf("Enter a number between 1-10:"); scanf("%d",&num); printf("\n"); switch (num) { case 1: printf("ONE"); break; case 2: printf("TWO"); break; case 3: printf("THREE"); break; case 4: printf("FOUR"); break; case 5: printf("FIVE"); break; case 6: printf("SIX"); break; case 7: printf("SEVEN"); break; case 8: printf("EIGHT"); break; case 9: printf("NINE"); break; case 10: printf("TEN"); break; default:         printf("THE ENTERED NUMBER IS NOT BETWEEN 1-10"); } } OUTPUTS

C program to print Armstrong numbers between 100 to 1000

C program to print Armstrong numbers between 100 to 1000


#include<stdio.h>
void main()
{
int y,i,n,a,sum;
printf("The ARMSTRONG numbers between 100 to 1000 are:");
for(i=100;i<1000;i++)
{
n=i;
sum=0;
while(n>0)
{
y=n%10;
a=y*y*y;
sum=sum+a;
n=n/10;
}
if(i==sum)
{
printf("\n %d",sum);
}
}
}

CLICK FOR THE VIDEO- https://youtu.be/ia8avh4Ddgw



OUTPUT


Comments