Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
which r the first 10 amstrong numbers??
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
#include<stdio.h> main(void) { int n; int i; printf("Type n: "); scanf("%d",&n); for(i=1;i<=n;i++) //generates natural numbers from 1,....,n. printf("%d\n",i); //prints these numbers to standard output }
Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.
I don't believe that 50 perfect numbers have ever been found, last time I checked there were only about 47 known perfect numbers. It would also require an extremely powerful computer.
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
By learning how to program on C+.
which r the first 10 amstrong numbers??
$n = 10*(1+10)/2;
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
#include<stdio.h> main(void) { int n; int i; printf("Type n: "); scanf("%d",&n); for(i=1;i<=n;i++) //generates natural numbers from 1,....,n. printf("%d\n",i); //prints these numbers to standard output }
This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.
For first find an example program.
int first= 1;
with a pencil
int i, sum = 0; for (i=0; i<20; i+=2) sum+=i;