CODE:- #include <stdio.h> int main() { int num,oct,rem; int total=0; int octal=0; printf("please enter the number that you want to convert into octal number:- "); scanf("%d",&num); int deci=num; do { rem=num%8; num=num/8; total=total*10+rem; } while(rem>0); total=total/10; printf("Total=%d\n",total); do { rem=total%10; total=total/10; octal=octal*10+rem; } while(rem>0); octal=octal/10; printf("octal of %d is %d",deci,octal); return 0; }
From the real time Experience of Rocky, We get following Tips:- Study Algorithms and Data Structure in confidently. Read other code. participate in competitive programming. like:-Hackerrank, codechef etc. Explore other language parallelly. finally build projects.
Comments
Post a Comment