C language Practice Programs

Write a C program to swap two bits in a bytes.

In the realm of programming, especially in languages like C, bit manipulation is a powerful tool that allows developers to perform various operations at the lowest level of data representation. One interesting task within this domain is swapping two bits within a byte. In this blog, we’ll delve into a simple yet insightful C program that accomplishes this bit-swapping magic.

Write a C program to find whether a given number is prime or not

given number is prime or not?
A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. In simpler terms, a prime number is only divisible by 1 and itself. For example, 2, 3, 5, 7, and 11 are prime numbers, while 4, 6, 8, and 9 are not, as they can be divided evenly by numbers other than 1 and themselves