Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to write a program to receive an integer & find its octal equivalent
by using for loop?



How to write a program to receive an integer & find its octal equivalent by using for loop? ..

Answer / neelkamal

#include"neel.h" // all header file store in neel.h
void rev(int *x) //declaration and body of function
{
int i,t, end=0,a,b;
clrscr();
while(x[end]!=NULL)
end++;
end=end-1;
for(i=0;i<=end/2;i++)
{
t=x[i];
x[i]=x[end];
x[end]=t;
end=end--;
}
i=0;
while(x[i]!=NULL)
{
printf(" %d",x[i]);
i++;
}
}
void main()
{
int x[20];
int n,i=0;
printf("\nenter any int to convert to octal:");
scanf("%d",&n);

for(i=0;i<=20;i++)
{
x[i]=n%8;
n=(n-x[i])/8;
}
rev(x);
getch();

}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

What is bash c?

0 Answers  


Why cant I open a file by its explicit path?

0 Answers  


i want to job in your company, so how it will be possible.

3 Answers   TCS,


what will happen if you free a pointer twice after allocating memory dynamically ?

3 Answers   Novell,


What is the purpose of 'register' keyword in c language?

0 Answers  


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

0 Answers  


how many key words availabel in c a) 28 b) 31 c) 32

0 Answers  


Is main a keyword in c?

0 Answers  


What are the 5 organizational structures?

0 Answers  


Do you know the use of fflush() function?

0 Answers  


What is the use of #define preprocessor in c?

0 Answers  


Why do some versions of toupper act strangely if given an upper-case letter?

0 Answers  


Categories