Motto: Mini-Project Based Learning



Students co-operated well in:
Using Spoken Tutorials, Video lecture from IIT-B, Regular home-work as a supplementary learning tool.
Lab-ia-2 as project based learning activity.



Saturday, October 20, 2012

C - Home Work


Please get the Spoken Tutorials videos from your friends who have copied from us and go through all videos in this order only, as below:


1) First C Program
2) First C Plus Plus Program
3) Tokens in C
4) Functions
5) Scope of variables
6) Check the conditions
7) Increment and Decrement Operators
8) Arithmetic Operators
9) Relational Operators
10) Logical Operators


The sequence mentioned is as recommended by IIT Bombay Spoken Tutorial team only.


If you want, you can download many such Free and Open Source Software videos from - http://spoken-tutorial.org/New


Please also go through and solve all the lab term works performed by your friends of A,C and D divisions. PFA a document on this regard.

Most of them are similar to what we have done in the lab.


Please share this mail with your class-mates.


Program list for the Labs
Div: D

Week 1st: Basic command execution
ΓΌ1 mkdir
cd
cd ..
vi
cat
tree
ls

Week 2nd: Simple C Programs:

C Program to print “Hello World” message.
C Program to find the addition of 2 numbers
C Program to find the subtraction of 2 numbers
C Program to find the multiplication of 2 numbers
C Program to find the division of 2 numbers
C Program to find the volume of a cylinder (vol=2*pi*r*r*h)
C Program to find the area and perimeter of the square (area=a*a perimeter=4*a)

Week 3rd: Programs on scanf statements:

C Program to read 2 values and do arithmetic operations.
C Program to read a side and find area, perimeter of a square.
C Program to read length and breadth and find area, perimeter of a rectangle.
C Program to read radius and find the area, perimeter of a circle.
C Program to read three sides and find the area of a triangle.
 area = sqrt(s*(s-a)*(s-b)*(s-c)) where s= (a+b+c)/2
C Program to convert Celsius into Fahrenheit and visa versa (c=5/9(f-32) )
C Program to read the values for a, b and c. evaluate & print the result for the expression:   c = a2+b2

Week 4th: Programs on evaluation of simple expressions:

Write a C program to evaluate the following expressions for the given a=3, b=4, c=1 and d=2.
a) ans = a2 + √ (b2 + c3)
b) ans1= √ (b2 – 4ac) / 2a
Write a C program to evaluate and print the values for a, b, c and d. (given a=2, b=1, c=3 and d=3)
c) c = a++ + ++b
d) b= ++a – b ++
e) a= d++ - b - -
f) d= --a + c - -
Write C program to convert a total number of days in months and days.


Write a C program to implement the following operators:
g) relational operator
h) conditional operator
i) logical operator

 Write a C program to implement the following operators:
j) Left shift
k) Right shift
l) Bitwise AND
m) Bitwise OR


Week 5th: Programs on Conditional statements

Write a C program to check whether a given number is even or odd using if else conditional statement.

Write a C program to find the biggest of 3 numbers using nested if else statement.

Write a C program to print the colors with respect to its color codes (given 1: RED, 2: GREEN, 3: WHITE and other: YELLOW) using nested if else statement.

Write a C program to find the roots of a quadratic equation ax2+bx+c=0 for all possible combinations of a, b and c. (using else if statement)
(Note: x= -b ±√ (b2-4ac) / 2a)
b2 - 4ac > 0      the roots are real and unequal
b2 - 4ac = 0      the roots are real and equal.  i.e   x=-b / 2a
b2 - 4ac < 0      the roots are imaginary.  i.e x=-b / 2a ± i √ (b2-4ac) / 2a)

Write a C program to print the grades of a student based on the marks obtained: (using switch statement)


Average marks Grade  
80 – 100 Honors  
60 – 79 First Class  
50 – 59 Second Class  
0 – 49 Fail

Write a C program for the following:
An electric distributor company charges its domestic consumers as follows:

Consumption in units Rate of Charge  
0 to 200 Rs. 0.50 per unit  
201 to 400 Rs 100 + Rs 0.65 per unit excess of 200  
401 to 600 Rs 230 + Rs 0.80 per unit excess of 400  
600 and above Rs 425 + Rs 1.25 per unit excess of 600

Print the amount to be paid by the customer. (Using else if ladder)


Week 6th: Programs on Decision making and looping

Write a C Program to find the sum of first n natural numbers using while loop.

Write a C Program print multiplication table starts with 1X1 and ends with 5X5 using do while loop.

Write a C Program to print multiplication table starts with 1X1 and ends with 10X10 using for loop.

Write a C Program to print GCD and LCM of 2 non negative integers.

Write a C Program to generate upto nth term in Fibonacci series.

Write a C Program to print all prime numbers upto 50.

No comments:

Post a Comment