Вы находитесь на странице: 1из 2

Computer Programming Utilization (2110003)

Date 13/10/19

EC Division
Assignment 2
Note: Submit the assignment in separate notebook.
Dead line for this Assignment is 20/10/16.
1.
2.
3.
4.
5.
6.
7.

Write the special features of C.


Write basic structure of C program.
What is Identifier? What are the rules for identifier?
Explain various primary data types available in C.
Explain User define data type.
Explain Const and Volatile variable.
What are various operators available in C? Explain Conditional operator and comma
operator.
8. What is implicit type conversion and explicit type conversion?
9. Write a C program to print Fibonacci series for given N terms.
1 1 2 3 5 8 13 21..N
10. Write c program to print sum of first 100 odd numbers.
11. Write c program to exchange (swap) the value of two variable.
12. Find the output of the followings:
(a)
main()
{

float

a, b, c, x, y, z;

a = 9;
b = 12;
c = 3;
x = a - b
y = a - b
z = a -(b
printf("x
printf("y
printf("z

/
/
/
=
=
=

3 + c * 2 - 1;
(3 + c) * (2 - 1);
(3 + c) * 2) - 1;
%f\n", x);
%f\n", y);
%f\n", z);

(b)

main()
{
int a, b, c, d;
a = 15;
b = 10;
c = ++a b++;
printf("a = %d b = %d

c = %d\n",a, b, c);

d = b++ ++a;

printf("a = %d b = %d d = %d\n",a, b, d);


printf("%d\n", (c>d) ? 4 : 2);

printf("%d\n", (c<d) ? 5 : 3);

13 Find the errors and Correct it.


Assume library files included.
(a) #Define const 23.5;
(b) int W_1&=23;
(c) #define t 12
main()
{
int t1,s;
t=t1;
scanf(%f,s);
}
(d)d = ++b++;
(e)int sale-dept;
(f)main()
{
const int a=5,b=5;
a=b;
}
*************************END************************************

Вам также может понравиться