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 |
How to reverse a string using a recursive function, with swapping?
i want to asked a question about c program the question is: create a c program that displays all prime numbers less than 500? using looping statement
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is the difference between call by value and call by reference in c?
write a program to convert a expression in polish notation (postfix) to inline (normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix
write a program to rearrange the array such way that all even elements should come first and next come odd
When is a “switch” statement preferable over an “if” statement?
If null and 0 are equivalent as null pointer constants, which should I use?
can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance
what are the interview question's in the language c
What is a Genralised LInked List?? Please give a detailed explation of it..
1 1 12 21 123 321 12344231 how i creat it with for loop??