Skip to main content

Posts

Showing posts from June, 2018

C program check whether a number is even or odd

Logic to check even or odd A number  exactly divisible  by 2 leaving no remainder, is known as even number. Programmatically, if any number modulo divided by 2 equals to 0 then, the number is even otherwise odd. Step by step descriptive logic to check whether a number is even or odd. Input a number from user. Store it in some variable say  num . Check if number modulo division equal to 0 or not i.e.  if(num % 2 == 0)  then the number is even otherwise odd. Important Note:  Do not confuse  modulo division operator   %  as percentage operator. There is no percentage operator in C. /** * C program to check even or odd number */ # include <stdio.h> int main ( ) { int num ; /* Input number from user */ printf ( "Enter any number to check even or odd: " ) ; scanf ( "%d" , & num ) ; /* Check if the number is divisible by 2 then it is even */ if ( num % 2 == 0 ) { /* num % 2 is 0 */

C Program to Check Whether a Number is Prime or Not

What is Prime number? Prime number  is a positive integer greater than 1 that is only divisible by 1 and itself. For example: 2, 3 , 5, 7, 11 are the first five prime numbers. Logic to print prime numbers between 1 to n Step by step descriptive logic to print all prime numbers between 1 to n. Input upper limit to print prime numbers from user. Store it in some variable say  end . Run a loop from 2 to  end , increment 1 in each iteration. The loop structure should be like  for(i=2; i<=end; i++) . Inside the loop for each iteration print value of  i  if it is  prime number /** * C program to print all prime numbers between 1 to n */ # include <stdio.h> int main ( ) { int i , j , end , isPrime ; // isPrime is used as flag variable /* Input upper limit to print prime */ printf ( "Find prime numbers between 1 to : " ) ; scanf ( "%d" , & end ) ; printf ( "All prime numbers between 1 to %d are:\n

Hacking For Dummies - Beginners Tutorials

Hacking For Dummies - Beginners Tutorials These tutorials are not really simple for anyone who is just starting to learn hacking techniques. However, these should be simple starting point for you. I am sure you have different opinion about complexity of each tutorial however advanced hacker are going to be calling this a job of script kiddie (beginner hacker). Even to acquire the skills of a script kiddie you need to have good understanding of computer fundamentals and programming. Cybrary  - For those looking to learn ethical hacking skills online, Cybrary provides the perfect platform to do so. Cybrary is a free online IT and cyber security training network that provides instruction in the form of self-paced, easy-to-follow videos. Featuring courses on topics such as Penetration Testing and Ethical Hacking, Advanced Penetration Testing, Post Exploitation Hacking and Computer and Hacking Forensics, Cybrary provides instruction from the beginner to the highly-advanced level of ha