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...

write a c-program to find gcd using recursive functions

Answer Posted / pavan_mustyala

int gcdRecurse(int a, int b)
{
int temp;

// error handling to prevent divide by zero
if(!b)
{
return b;
}

temp = a % b;

if (temp == 0)
{
return(b);
}
else
{
return(gcdRecurse(b, temp));
}
}

Is This Answer Correct ?    30 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

2649


What is full form of PEPSI

2373


why nlogn is the lower limit of any sort algorithm?

2793


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

950


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1582


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2499


could you please send the program code for multiplying sparse matrix in c????

3533


Write a program to model an exploding firecracker in the xy plane using a particle system

4101


Develop a routine to reflect an object about an arbitrarily selected plane

3556


Design an implement of the inputs functions for event mode

3467


What is data _null_? ,Explain with code when u need to use it in data step programming ?

3294


How can you relate the function with the structure? Explain with an appropriate example.

3394


write a program for area of circumference of shapes

2514


how to test pierrot divisor

2723


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2727