Beruflich Dokumente
Kultur Dokumente
GRADE X
a) #include <stdio.h>
enum month {jan= 1,feb, march = 5, april, may = 10,
june, july};
int main()
{
printf("%d %d %d %d %d %d %d",jan,feb,march,april,may,june,july);
);
return 0; }
b) int main()
{
int a=5;
label:
Printf(hello world);
if(a==5)
{
Goto label;
}
printf(out of goto);
return 0;
}
c) Void main()
{
int num=2;
while(num<=4)
{
Printf(%d,num);
num =num+2;
}
}
1. Write a C program to find out the area of the different shapes using
SWITCH-CASE Statement
Circle: = r2
Rectangle: = w h
Area=Side*Side
Triangle= b h
2. Write a program to print even numbers from 100 to 50 using do-while loop.
3. Write a program to find the product of n numbers using continue statement
4. write a program to swap two numbers without the third variable
5. Write a program to find factorial of a number entered by the user
6. Write a program to print sum of first ten natural numbers.
7. Write a program to find the sum of all positive numbers till the user enters a zero.
8. Write a program to calculate income tax of an employee based on the basic pay .
9. Write a program to find area of triangle using herons formula.
10. Write a program to print odd numbers from 99 to 49 using do-while loop.
11. Write a program to find the product of n numbers using continue statement.
12. Write a program to find the area of any 2 geometrical shape using switch.
13. Write a program to swap two numbers without the third variable.
14. Write a program to print the working timings of DEWA office by getting the day from the user.
16. Write a program to find the sum of all positive numbers entered by the user until user enters 0.