Posts

Showing posts from June, 2022

Whether a given number is prime or not

Image
#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

Image
  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 ·         The total time to   carry out all the steps in the algorithm must be finite. ·         After performing the instructions given in the algorithm ,the desired results must be obtained.   APP

C Program to Check Odd or Even using IF Condition

Image
   #include<stdio.h> int main() {   int number;   printf(" Enter an int value to check Even or Odd \n");   scanf("%d", &number);   if ( number%2 == 0 ) //Check whether remainder is 0 or not      printf("Given number %d is EVEN NUMBER \n", number);   else     printf("Given number %d is ODD NUMBER \n", number);   return 0; }   Output Enter an int value to check even or odd :3 Given   number 3 is   ODD NUMBER   Enter an int value to check even or odd :2 Given   number 2 is   EVEN   NUMBER    

What is computer ?

Image
  A n electronic device for storing and processing data. It is typically in binary form, according to instructions given to it in a variable program. Is a programmable electronic device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations .  Mainframes, desktop and laptop computers, tablets, and smartphones are some of the different types of computers.