Posts

Showing posts with the label Control Statement

C-Control Statement Codes (52 Questions Solved)

Image
 1.Write a program to find the given number is positive or negative #include <stdio.h> int main() {     int a;     printf("Enter the number, a: ");     scanf("%d", &a);          if (a > 0) {         printf("Positive Number");     } else {         printf("Negative Number");     }          return 0; } 2. Write a program to find the given number is odd or even #include <stdio.h> int main() {     int a, R;     printf("Enter the number, a: ");     scanf("%d", &a);          R = a % 2;          if (R == 0) {         printf("Even Number");     } else {         printf("Odd Number");     }          return 0; } 3. WAP to read a number from the user and whether a given nu...