Call the unknown number n. From the problem statement (n + 3)2 - (n + 2)2 = 11. Expanding both squares yields n2 + 6 n + 9 - (n2 + 4n + 4) = 11, or 2 n + 5 = 11, 2n = 6, n = 3.
n = number n + 6 ======
void main () { int no1, sum, n; clrscr() sum = 0; n = 1; printf("\n enter the number to which sum is to be generated"); scanf("%d",&no1); while(n<=no1) { sum=sum+n; n=n+1 } printf("\n the sum of %d = %d, no1, sum"); getch (); }
class Sum_Of_Digits { public static void printSumandnoofdigits(int n) { int temp = n; int count = 0; int sum = 0; while ( n > 0 ) { sum = sum + n % 10; n = n / 10; count ++; } System.out.println("The number is..." + temp ); System.out.println("The sum of digits is..." + sum); System.out.println("The number of digits is..." + count); } }
(The assumes that "the number" in the question is not n, although if they are they same number, this is still true.) "If the sum of the digits of the number is divisible by n, then the number itself is divisible by n" is true if n is 3 or if n is 9.
-11 + n
n3 + 11*n
Call the unknown number n. From the problem statement (n + 3)2 - (n + 2)2 = 11. Expanding both squares yields n2 + 6 n + 9 - (n2 + 4n + 4) = 11, or 2 n + 5 = 11, 2n = 6, n = 3.
11 (interior angles total 18 x 90)
let the number be n, then the sum of the number and 2 is n+2
write an algo to find the sum of even number from 1to n
If the number is n, then twice the number is 2n and the sum of the two is n + 2n = 3n.
1620 the equation to find the sum of the interior angles for any regular polygon is: (n-2)x180, where n=the number of sides.
n = number n + 6 ======
This is simple algebra. Let the unknown number be n. Then the sum of this number and 8 = n + 8.
void main () { int no1, sum, n; clrscr() sum = 0; n = 1; printf("\n enter the number to which sum is to be generated"); scanf("%d",&no1); while(n<=no1) { sum=sum+n; n=n+1 } printf("\n the sum of %d = %d, no1, sum"); getch (); }
class Sum_Of_Digits { public static void printSumandnoofdigits(int n) { int temp = n; int count = 0; int sum = 0; while ( n > 0 ) { sum = sum + n % 10; n = n / 10; count ++; } System.out.println("The number is..." + temp ); System.out.println("The sum of digits is..." + sum); System.out.println("The number of digits is..." + count); } }