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 |
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Do you have any idea about the use of "auto" keyword?
write a progam to compare the string using switch case?
write aprogram for There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.
1 Answers iGate, Shashi, Source Bits, Subex,
input any 4 digit number and find the difference of all the digits?
How to receive strings with spaces in scanf()
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
State the difference between x3 and x[3].
how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .
Explain null pointer.
Explain modulus operator. What are the restrictions of a modulus operator?
What are the ways to a null pointer can use in c programming language?