C Programming Tutorial

 
 
 
 

Image

#include <stdio.h>
#include <conio.h>
void main(){
     int num,i;
     clrscr();
     printf(\"*****PRIME NUMBER*****\\n\\n\");
     printf(\"Enter the number to find it is prime or not : \");
     scanf(\"%d\",&num);
     for(i=2;i<num;i++){
    if(num%i==0){
       printf(\"\\n\\n%d is Not a Prime Number\\n\",num);
       printf(\"It is divisible by %d, ...\",i);
       goto out;
    }
     }
     printf(\"\\n\\n%d is a PRIME number\",num);
    out:
    getch();
}

    Related Post:
  1. Program that performs add, edit, delete, display and search data from file

  2. PROGRAM TO CALCULATE BONUS, COMMISSION AND GROSS SALARY OF A SALESMAN

  3. Program to convert decimal to octal

  4. Program to solve the backward dependency for the following equation using crude way x[i]=x[i-1]+y[i]

  5. Program to assign the pointer variable to another pointer and display the contents of both pointer variables

  6. PROGRAM OF Matrix Multiplication

  7. Program to find out the sum of odd and even numbers between given range

  8. Program of histogram by calculating the partial histograms and consolidating in the end to get the final histogram

  9. Write a function to perform string operation i.e. split, join, length, substring using pointer without using any string function

  10. Program to encode and decode given string

  11. Program to insert and delete a node from the binary search tree

  12. Program to compare one string s2 to another string s1 and also first unmatched characters without using strcmp function from string.h

  13. ILLUSTRATION OF POINTERS TO FUNCTIONS

  14. Program to convert an expression in postfix form to an infix form

  15. Program to show the Basic Mouse Handling in Graphics Mode

  16. Program to read string using gets() function and display in upper case

  17. Sum of numbers from 1 to 10, by dividing the job into two processes

  18. Program to copy the contents of one array to another without shared memory

  19. Program to swap even positioned characters with odd positioned characters in a given string

  20. Function to find the binary equivalent of a given decimal integer and display it

 
 
Didn't find what you were looking for? Find more on Program to find entered number is prime number or not