Posts

Showing posts with the label Long questions

Conditional Control structure. Chapter 4, Lab Activities, Long questions.

Image
  Chapter # 4 Conditional Control structure LAB ACTIVITIES                                LONG QUESTIONS               Question 1. Write a program that reads a number and prints its square if it is greater than 10. Ans: Program: #include<stdio.h> #include<conio.h> int main(int) {             int n;             printf(“\nEnter a number:”);             scanf(“%d”, &n);             if(n>10)             printf(“\nThe square of %d is %d”, n, n*n); getch(); } Output: Enter a number:12 The square of 12 is 144. Question 2. Write a program that reads t...