C program to set nth bit of a number

Write a C program to input any number from user and set nth bit of the given number as 1. How to set nth bit of a given number using bitwise operator in C programming. Setting nth bit of a given number using bitwise operator.

Example

Input

Input number: 12
Input nth bit to set: 0

Output

Number after setting nth bit: 13 in decimal

Read more

C program to get nth bit of a number

Write a C program to input any number from user and check whether nth bit of the given number is set (1) or not (0). How to check whether nth bit of a given number is set or unset using bitwise operator in C programming. C program to get the status of nth bit of a number.

Example

Input

Input number: 12
Input nth bit number: 2

Output

2 bit of 12 is set (1)

Read more

C program to check even or odd using bitwise operator

Write a C program to input any number and check whether the given number is even or odd using bitwise operator. How to check whether a number is even or odd using bitwise operator in C programming. Logic to check even odd using bitwise operator in C programming.

Example

Input

Input number: 12

Output

12 is even

Read more

C program to check Most Significant Bit (MSB) of a number is set or not

Write a C program to input any number from user and check whether Most Significant Bit (MSB) of given number is set (1) or not (0). How to check whether Most Significant Bit of any given number is set or not using bitwise operator in C programming. C program to get the status of the most significant bit of a number.

Example

Input

Input number: -1

Output

Most Significant Bit (MSB) of -1 is set (1).

Read more

C program to check Least Significant Bit (LSB) of a number is set or not

Write a C program to input any number from user and check whether the Least Significant Bit (LSB) of the given number is set (1) or not (0). How to check whether the least significant bit of a number is set or unset using bitwise operator in C programming. C program to get the status of least significant bit of a number.

Example

Input

Input number: 11

Output

Least Significant Bit of 11 is set (1).

Read more

C program to remove first occurrence of a word from string

Write a C program to input any string from user and remove first occurrence of a given word from string. Write a function to remove first occurrence of a word from the string. How to remove first occurrence of a word from the string in C programming. Logic to remove first occurrence of a word from given string.

Example

Input

Input string : Learn programming at Codeforwin.
Input word to remove : Learn

Output

String after removing 'Learn': 
programming at Codeforwin.

Read more

C program to find last occurrence of a character in a string

Write a C program to input any string from user and find the last occurrence of a given character in the string. How to find the last occurrence of a given character in the string. Logic to find last occurrence of a given character in a string in C program.

Example

Input

Input string: I love Codeforwin.
Input character to search: o

Output

Last index of 'o' is 12.

Read more

C program to remove all occurrences of a character from string

Write a C program to remove all occurrences of a given character from the string using loop. Write a function to remove all occurrences of a character from a string. How to remove all occurrences of a character from the string in C programming. Logic to remove all occurrences of a character from a given string in C program.

Example

Input

Input string : I Love Programming. I Love Codeforwin.
Input character to remove : 'I'

Output

String after removing all 'I' : Love Programming. Love Codeforwin.

Read more

C program to remove last occurrence of a character from the string

Write a C program to read any string from user and remove last occurrence of a given character from the string. How to remove the last occurrence of a character from string in C programming. Logic to remove last occurrence of a character from the string.

Example

Input

Input string : I love programming. I love Codeforwin.
Input character to remove : 'I'

Output

String after removing last 'I' : I love programming. love Codeforwin.

Read more

C program to remove first occurrence of a character from string

Write a C program to read any string from user and remove first occurrence of a given character from the string. The program should also use the concept of functions to remove the given character from string. How to remove first occurrences of a given character from the string.

Example

Input

Input string: I Love programming. I Love Codeforwin. I Love India.
Input character to remove: 'I'

Output

Love Programming. I Love Codeforwin. I Love India.

Read more