Posts

Showing posts with the label armstrong number

convert string value into fractional in ruby on rails

Convert string value into fractional self.try(:shipping).fractional.to_f   // this will convert string value to fractional example- if  self.try(:shipping)  =>   #<1500 Euro shiiping> then   self.try(:shipping).fractional.to_f will return 1500

you should install 'babel-loader@7'. || babel version

If you are Getting any error in compiling main.js or app.js or in Entry file of React App You have to Update Babel versions and dependency npm install -D babel-loader @babel/core @babel/preset-env webpack And change config file options: {           presets: ['@babel/preset-env']         }

C program to print Armstrong numbers from 1 to 1000?

  #include<stdio.h> #include<conio.h> void main() { int i=153,n,temp,num,r,sum=0; clrscr(); while(i<=1000) { n=i; temp=n; while(n>0) { r=n%10; sum=sum+(r*r*r); n=n/10; } if(temp==sum) { printf("the armstrong number is %d\n",sum); } i++; } getch(); }