You are on page 1of 2

ASSIGNMENT I

BTE/BTB/BTC/BTCE/BTI 104 & BCA - 103


Introduction to Computers and Programming in C
1. Discuss the History of our Programming Language.
2. Enlist the steps of program execution in C. Explain in detail.
3. List the name of commonly found errors in C. Give example of each.
4. Describe the characteristics of writing a good program.
5. Write the Applications and features of C.
6. Write a short note on data types in C.
7. Explain all the operators discussed in C with the help of examples.
8. (a.)Find the output of the following program? Explain the output.

#include <stdio.h>
main() {
int value1 = 2, value2 = 4;
value1 += value2;
value2 += value1;
value1 += value2;
printf("Value1 = %d, Value2 = %d\n", value1, value2);
}

(b.) #include<stdio.h>
int main(){
int x = 3;
float y = 3.0;
If(x == y)
printf("x and y are equal");
else
printf("x and y are not equal");
return 0;
}

A. x and y are equal B. x and y are not equal
C. Unpredictable D. No output

(c.) int main()
{
float pi=3.14, x=3.7;
int a, b;
a= ( pi = = 3.14);
b= (x = = 3.7);
printf(%d %d, a, b);
return 0;
}

(d.) void main()
{
int a, b, c;
a = 10, b=20, c=30;
b += a;
c -= a;
printf (\n %d %d %d, a, b, c);
}

9. WAP that read three numbers and display the largest of them.
10. The length and breadth of a rectangle and radius of a circle are input through the
keyboard. WAP to calculate the area and perimeter of the rectangle, and the area &
circumference of the circle.
11. Two numbers are input through the keyboard into two locations P and Q. WAP to
interchange the contents of P and Q.
12. If a five-digit number is input through the keyboard, WAP to reverse the number.
13. If a five-digit number is input through the keyboard, WAP to calculate the sum of its
digits.
14. A company ensures its drivers in the following cases:
- If driver is married,
- If the driver is unmarried, male and above 30 years of age.
- If the driver is unmarried, female and above 25 years of age.
In all other cases, the driver is not insured. If the marital status, gender and age of
the driver are the inputs, WAP to determine whether the driver is to be insured or
not.
15. Any year is input through the keyboard. WAP to find out whether it is an odd
number or even number. [ Hint: Use of % (modulus) operator ]

You might also like