Category Archives: C Programs using Simple if statement

C Program to use simple if statement to check positive negative or zero

Q: Write a C Program to use simple if statement to check positive negative or zero How to check for positive number A number is positive if it is greater than 0 (zero). Use simple if statement. if (number > 0) printf(“Number is positive”); What is the condition for negative number Use simple if statement… Read More »

C Program to Calculate Square Root of a Positive Number

Q: Write a C Program to Calculate Square Root of a Positive Number How To Calculate Square Root of a number in C Programming We use built-in function sqrt() to calculate square root of a number. Include Header File math.h for sqrt() function We must include math.h header file with the help of pre processor… Read More »