#include<stdio.h> void main() { int n,i=2; printf("\nEnter a number \n"); scanf("%d",&n); for(i=2;i<=n-1;i++) { if(n%i==0) { printf("%d isn't prime...!\n",n); break; } } if(i==n) printf("%d is prime...!\n",n); } Output Video Class : Prastheena Learning Class
ALGORITHM * The origin of the word algorithm to a famous Arab mathematician, ABU JAFAR MOHAMMED IBN MUSAA AL- KHOWARIZMI . * T he word 'algorithm' is derived from the last part of his name AL-KHOWARIZMI. * In computer terminology an algorithm may be defined as a finite sequence of instructions to solve a problem. * It is a step-by-step procedure to solve a problem, where each step represents a specific task to be carried out. CHARACTERISTICS · It should begin with instructions to accept inputs. · Use variables to refer the data , where variables are user-defined works consisting of alphabets & numerals. · Each & every instructions should be precise & unambiguous. · Each instructions must be sufficient · ...
Comments