Not putting // before the start of single statement comment is a compiler error. Not putting the */ after the termination of block comment is a compiler error.

The test expression done on exact statement. The good habit of using test expression on exact or fulfill statement. So do not use floating point numbers for checking for equality in the test expression.

Semoclone ( ; ) is one of the best sensitive symbols in programming. Placing a semicolon ( ; ) after the WHILE or FOR loop is not a syntax error. So it will not be reported by the compiler. However, it is considered to be a logical error as it change

Specifier is a typedef-name and a very sensitive in C programming. Using an incorrect specifier for the data type being read or written will generate a run time error.

When you are using SWITCH case, it is important to keep in mind that the inclusion of DEFAULT LABEL. This will inform you whether you are executing your program in right or wrong way. So, it is always recommended to use DEFAULT LABEL in the SWITCH st

A prime number is a whole number greater than 1 whose only factors are 1 and itself. A factor is a whole numbers that can be divided evenly into another number. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19 and 23. Numbers that have more than two factors are called composite numbers. The number 1 is neither prime nor composite.

// AHF C PROGRAM SOLVING //solving here ITERATIVES STATEMENTS type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int n,m,fact=0,i; //taking the number to continue loop pf("Enter any number: "); scanf("%d",&n); //testing the given number is prime or not for(i=2;i<n/2;i++) { if(n%i==0) { fact=1; break; } } //printing the result if(fact==0) pf("\n%d is prime number",n); else pf("\n%d is composite number",n); return 0; }

Enter any number: 20

20 is composite number

Enter any number: 23

23 is prime number

20 is composite number

Enter any number: 23

23 is prime number

- Print whether given number is prime or composite
- Prime number in a range
- Leap year in a range
- Print a multiplication table of Nth number
- Print even and odd number in a range
- Calculate power i.e., calculate x
^{n} - Calculate Summation of this series 1 + 1/2 + 1/3 + ...... + 1/x
- Calculate Summation of this series 1 + 1/5 + 1/9 + 1/13 + ...... + 1/x
- Calculate Summation of this series 1 + 2
^{2}+ 3^{3}+ ...... + x^{x} - Calculate Summation of this series 1 + 2
^{2}+ 3^{2}+ ...... + x^{2} - Bonus on employment salary
- Print even or odd number
- Leap year
- Input any key from key-board and display key's feature
- Find is the given number positive, negative and zero

© 2018 - All rights reserved