What is wrong with this code

+2 osh Ranw · June 3, 2015
i make a program that find the octal equivalent of the entered number,


for some reason it shows a number less ,can anyone tell me where is the error of this?

http://i1158.photobucket.com/albums/p604/Oshadha4/Captur1e_zpsijfhrtht.jpg


CODE HERE- http://paste2.org/59n5sCmx


#include 
#include
#include

int main()
{
    int gotvalue,Octal = 0,i;
printf("enter the number you want to convert in to octal \n");
scanf(" %d", &gotvalue);
int valuebackup= gotvalue;

 int NoOfDigits = 1 + (int)log10(gotvalue);

for(i=0 ; i

Post a Reply

Replies

Oldest  Newest  Rating
+1 osh Ranw · June 3, 2015

#include
#include
#include

int main()
{
    int gotvalue,Octal = 0,i;
printf("enter the number you want to convert in to octal \n");
scanf(" %d", &gotvalue);
int valuebackup= gotvalue;

 int NoOfDigits = 1 + (int)log10(gotvalue);

for(i=0 ; i
  • 1

C

107,222 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator