Noise pollution is a significant environmental issue, particularly in industrial settings. The constant hum of machinery, the clanging of metal, and the roar of engines contribute to a cacophony that can have serious health implications for workers and nearby residents. Addressing noise pollution in industries is not only a matter of regulatory compliance but also a crucial step in ensuring the well-being of employees and the community. Understanding Noise Pollution in Industries Industrial noise pollution stems from various sources such as heavy machinery, generators, compressors, and transportation vehicles. Prolonged exposure to high levels of noise can lead to hearing loss, stress, sleep disturbances, and cardiovascular problems. Beyond health impacts, noise pollution can also reduce productivity, increase error rates, and contribute to workplace accidents. Regulatory Framework Many countries have established regulations and standards to limit industrial noise. Organizations like t
C program to check if a number is binary or not
int isBinary(int num) {
while (num != 0) {
if (num % 10 > 1) {
return 0;
}
num /= 10;
}
return 1;
}
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (isBinary(num)) {
printf("%d is a binary number.\n", num);
} else {
printf("%d is not a binary number.\n", num);
}
return 0;
}
Explanation :
This program defines a function isBinary that takes an integer num as input and returns 1 if num is a binary number, and 0 otherwise. The function checks each digit of the number by dividing it by 10 and checking if the remainder is greater than 1. If any digit is greater than 1, the function returns 0, indicating that num is not a binary number. If all digits are less than or equal to 1, the function returns 1, indicating that num is a binary number.
In the main function, the program prompts the user to enter a number and then calls the isBinary function to check if the number is binary. Depending on the result, the program prints a message to the console indicating whether the number is binary or not.
Sample output:
Here's an example output of the program for the input of the number 10101010:
Enter a number: 10101010
10101010 is a binary number.
And here's an example output of the program for the input of the number 1234:
Enter a number: 1234
1234 is not a binary number.