From 9853edbea0d0480e14fae0434ef639988d50f643 Mon Sep 17 00:00:00 2001 From: himanta1012 <50390378+himanta1012@users.noreply.github.com> Date: Fri, 11 Oct 2019 00:18:23 +0530 Subject: [PATCH] added sol. for que 9 (medium) in m9.c --- m9.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/m9.c b/m9.c index e69de29..00e768a 100644 --- a/m9.c +++ b/m9.c @@ -0,0 +1,18 @@ +#include +int main(){ + int num,r,sum,temp; + + for(num=1;num<=500;num++){ + temp=num; + sum = 0; + + while(temp!=0){ + r=temp%10; + temp=temp/10; + sum=sum+(r*r*r); + } + if(sum==num) + printf("%d ",num); + } + + return 0;