C Program to use bitwise AND operator between the two integers
& (bitwise AND) Takes two numbers as operands and does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1. #include…
q
& (bitwise AND) Takes two numbers as operands and does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1. #include…
#include #include void main() { int n,i,sum=0; clrscr(); printf(“Enter any no: ”); scanf(“%d”,&n); for(i=1;i
#include #include void main() { int n,i,sum=0; clrscr(); printf(“Enter any no: ”); scanf(“%d”,&n); printf(“1”); for(i=2;i
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. #include #include void main() { int i,n,r=0; clrscr(); printf(“Enter any…
The factorial of a number n is defined by the product of all the digits from 1 to n (including 1 and n). Here we write program, how to print…
Fibonacci Series is a series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers starting with 0 and 1.Logic: Initialize first…
#include #include void main() { int i,j; clrscr(); for(i=1;i
A natural number is a number that occurs commonly and obviously in nature. As such, it is a whole, non-negative number. The set of natural numbers, denoted N, can be…
Left shift operator shifts all bits towards left by certain number of specified bits. It is denoted by <<.Example: Given Number is 2. convert 2 into binary i.e 0010 2…
An even number is an integer that is exactly divisible by 2. Example: 0, 8, -24 An odd number is an integer that is not exactly divisible by 2. Example:…