Sunday, 28 May 2017

wap to program define armstrong in macro in c

wap to program define armstrong in macro in c

#include<stdio.h>
#define mul r*r*r
#define i if(sum==temp)
#define p1 printf("its armstrong")
#define e else
#define p2 printf("its not armstrong")
int main()

{
    int r,temp,n,sum;
    printf("enter the number ");
    scanf("%d",&n);
    temp=n;
    while(n!=0)
    {
        r=n%10;
        n=n/10;
        sum=sum+(r*r*r);
    }
    i p1; e p2;
    return 0;
}


 →→→→→→↠ click here for more c programs

thanks :)
post by #admin ( #dynamiteRohit)

No comments:

Post a Comment