include int main(){int no1,no2,temp_variable,gcd;scanf(“%d%d”,&no1,&no2);while(no2!=0){temp_variable=no2;no2=no1%no2;no1=temp_variable;}gcd=no1;printf(“gcd of two numbers is %d”,gcd);} OUTPUT for GCDINPUT:9612OUTPUT:gcd of two numbers is 12
Start reading GCD of Two Numbers Without using LCM in CCategory: Programs
include int fib (int);int main (){int n, result;printf (“Enter the Nth Number: “);scanf (“%d”, &n);result = fib (n);printf (“The %dth number in Fibonacci series is %d\n”, n, result);return 0;} /* function for recursive fibonocci call */int fib (int n){if (n == 0){return 0;}else if (n == 1){return 1;}else{return (fib (n – 1) + fib (n …
Start reading C Program to Find Nth Fibonacci Number Using RecursionAlgorithm for to calculate monthly bill of newspaper Algorithm: Read the number of days. Read the new paper cost. Read the Service charge. if there is a service charge, calculate price using service charge + (no of days* news paper cost) If there is no service charge calculate using, no of days* news paper cost print the …
Start reading C Program for Monthly Bill of a Newspaper