Skip to main content

Important Formulas of Number System

Formulas of Number Series
  1. 1 + 2 + 3 + 4 + 5 + … + n                      =    n(n + 1)/2
  2. (12 + 22 + 32 + ..... + n2)                        =    n ( n + 1 ) (2n + 1) / 6
  3. (13 + 23 + 33 + ..... + n3)                        =    (n(n + 1)/ 2)2
  4. Sum of first n odd numbers                   =    n2
  5. Sum of first n even numbers                 =    n (n + 1)

Mathematical Formulas
  1. (a + b)(a - b)                        =             (a2 - b2)
  2. (a + b)2                                          =             (a2 + b2 + 2ab)
  3. (a - b)2                                           =              (a2 + b2 - 2ab)
  4. (a + b + c)2                                 =               a2 + b2 + c2 + 2(ab + bc + ca)
  5. (a3 + b3)                              =              (a + b)(a2 - ab + b2)
  6. (a3 - b3)                               =              (a - b)(a2 + ab + b2)
  7. (a3 + b3 + c3 - 3abc)          =              (a + b + c)(a2 + b2 + c2 - ab - bc - ac)
  8. When a + b + c = 0, then a3 + b3 + c3         =         3abc
  9. (a + b)n                               =        an + (nC1)an-1b + (nC2)an-2b2 + … + (nCn-1)abn-1 + bn

Shortcuts for number divisibility check
  1. A number is divisible by 2, if its unit's digit is any of 0, 2, 4, 6, 8.
  2. A number is divisible by 3, if the sum of its digits is divisible by 3.
  3. A number is divisible by 4, if the number formed by the last two digits is divisible by 4.
  4. A number is divisible by 5, if its unit's digit is either 0 or 5.
  5. A number is divisible by 6, if it is divisible by both 2 and 3.
  6. A number is divisible by 8, if the number formed by the last three digits of the given number is divisible by 8.
  7. A number is divisible by 9, if the sum of its digits is divisible by 9.
  8. A number is divisible by 10, if it ends with 0.
  9. A number is divisible by 11, if the difference of the sum of its digits at odd places and the sum of its digits at even places, is either 0 or a number divisible by 11.
  10. A number is divisible by 12, if it is divisible by both 4 and 3.
  11. A number is divisible by 14, if it is divisible by 2 as well as 7.
  12. Two numbers are said to be co-primes if their H.C.F. is 1. To find if a number, say y is divisible by x, find m and n such that m * n = x and m and n are co-prime numbers. If y is divisible by both m and n then it is divisible by x.

Comments

Popular posts from this blog

ORACLE 9i practice solutions

Created by BCL easyConverter SDK 3 (HTML Version)

C Questions

C Questions
C Questions

Note : All the programs are tested under Turbo C/C++ compilers.
It is assumed that,
Programs run under DOS environment, The underlying machine is an x86 system, Program is compiled using Turbo C/C++ compiler.
The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).
Predict the output or error(s) for the following:

void main()
{
int const * p=5; printf("%d",++(*p));
}
Answer:
Compiler error: Cannot modify a constant value.
Explanation:
p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".
main()
{
char s[ ]="man"; int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}
Answer: mmmm
aaaa nnnn
Explanation

Zoho Interview | Set 1 (Advanced Programming Round)

Third Round: (Advanced Programming Round) Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:
    1. Booking
    2. Availability checking
    3. Cancellation
    4. Prepare chart
We were asked to create the modules for representing each data first and to continue with the implementation phase.

 My Solution :

#include<stdio.h>#include<conio.h>#include<stdlib.h>#include<string.h>#include<iostream.h>#include<time.h>#include<iomanip.h>#include<fstream.h>char f[10]="f";char s[10]="s";int addr,ad,flag,f1,d,m,i,amt;float tamt; class login {public:char id[100];char pass[100];char*password;void getid(){ cout<<"Enter your id:";gets(id); password=getpass("Enter the password:");strcpy(pass,password);}void displayid(){ cout<<"Id:";puts(id); cout<<"Password:";puts(pass);}}; class detail {public:in…