#include<stdio.h>
#include<conio.h>
void lcm(int m,int n)
{
for(i=1;i++)
{
if(i%m==0&&i%n==0)
return i;
}
}
void main()
{
clrscr();
int a,b;
a=19;b=20;
printf("lcm is %d",lcm(a,b));
getch();
}
Write a program using recursion which should take two values and display 1st value raised to the power of second value.
123
recu
program to find maximum of two numbers using pointers
write an assembly language program to find sum of N numbers
To write a C++ program to display the student details using class and array of object.
int sum(n) { if (n==0) return 0; else return n+sum(n-1); }
i need this answer
12
swap (int *a, int *b) { *a ^= *b; *b ^= *a; *a ^= *b; }
Please visit http://talentsealed.blogspot.com/2009/10/to-find-sqaure-of-numbers-using-c.htmlfor the answer.
#include<iostream> unsigned fib (unsigned term, unsigned a=0, unsigned b=1) { if (term<1) return a; return fib (--term, a+b, a); } int main() { std::cout << "Fibonacci (1000th term): " << fib (1000) << std::endl; }