I found this code working fine. it uses another recursive call from a recursive call.. I don't know if calling them master-slave is valid or not.. but it is good learning about recursive functions...
Type: Posts; User: kawaikx15
I found this code working fine. it uses another recursive call from a recursive call.. I don't know if calling them master-slave is valid or not.. but it is good learning about recursive functions...
for learning purpose, How could we possibly use an recursive call from master recursive call? would be interesting to know..
you are right.. I finally found a pure recursive solution with just one recursive function.
/*prime factor by recursion*/
#include<stdio.h>
int rec (int,int); /* this semi colon is must*/
int...
thinking more recursively, I changed the while(1) loop into another recursive call:
/*prime factor by recursion*/
#include<stdio.h>
int rec (int,int);
int rec1 (int, int); /* this semi colon is...
so what you think must be the right recursive solution for this problem? shall I replace the while loop with another recursive call to says rec1?
Salem, I feel while(1) is must in this case since we don't know the number of loops required. I put the if condition at right place and got the code running fine. here is the edited version:
...
I wrote a code below to find out the prime factors using recursion. it runs fine but terminates with a message: primfactor.exe has stopped working. check for online solution.. any idea why so?
...
you may find it interesting :
Roman numerals - Wikipedia, the free encyclopedia
it says that there is no standardization of the rules and there may be multiple ways of writing the same roman...
thanks to you both... problem solved and new things learnt..
I am using windows 7 and gcc to compile and run c programs from command prompt. I created a code to convert year into its roman equivalent. when i run the code, it won't give the answer till I press...
I am a beginner, using Windows 7 and MingW for compiling c programs that I write.. I wish to learn how to draw lines, arc, circles (graphics) in C - programming. the book I am referring to uses...
can function prototypes be mentioned inside the main function , before the definition of functions? or is it that all prototypes to be mentioned in the beginning of the source code before main() ?
friends, i am new to C. I learnt today about getchar() and putchar() functions and calling them. The book (by Denis Ritchie) says that getchar reads one character at a time and putchar prints a...
thanks guys.. i got it..
friends, I am new to C. just begun.
I need help to understand the hierarchy of the operators used in C and how they affect the evaluation of the expressions containing them..
Q. Is it that any...
friends, I am new to C. here is problem, whose output I could not understand. could you please help me out?
main()
{
int i=4,j=-1,k=0,w,x,y,z;
w=i||j||k;
x=i&&j&&k;
y=i||j&&k;