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

LAB OBSERVATION Book


Hi All,

You are required to complete your LAB OBSERVATION book mentioning

            Date

            Problem Definition

            Flow-Chart

            Program

            Output

for all the programs done till date – 21/Nov/2012

Regards,

Mayur Patil 

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.

Wednesday, October 17, 2012

No C Class On Thursday - 18.Oct.2012


Dear All,

There wont be *C* class on 18.Oct.2012 , Thursday, as I shall be out of Station on official work.

If you are interested, you can request through your CR, to any other faculty to engage that class from 11:30AM onwards.

(Please do not make noise on the corridor after finishing your class from 10:30 to 11:30AM.)

Please inform your class-mates.

Tuesday, October 16, 2012

Sample Programs on if-else forms


Dear All,


PF below 10 problem statements to check your understanding on if-else concept.
Please share with your class-mates.


“if – else” forms:

1) if (expression)
     statement;

OR

2) if (expression)
    {
     Block of statements;
   }

OR

3) if (expression)
    {
     Block of statements;
    }
else
  {
    Block of statements;
  }

OR

4) if (expression)
     {
      Block of statements;
     }
   else if(expression)
    {
     Block of statements;
    }
else
  {
    Block of statements;
  }













“if – else” problem definitions:

1) Write a C program to find the larger of two numbers.

2) Write a C program to find the largest of three numbers.

3) Write a C program to check whether a number is even or odd.

4) Write a C program to find the electricity bill given the units consumed under the following conditions:
   Units                            Charge
0 – 100  Rs. 0.85 per unit.
101 – 200  Rs. 0.95 per unit over and above 100 units
> 200  Rs. 1.05 per unit over and above 200 units.

                     In addition to the above charge, the minimum charge of Rs. 100/-
                     is incurred on every bill.

5) Write a C program to print the grade of the student given the marks in five subjects.
Percentage Grade
 < 35 F
36-50 E
51-59 D
60-69 C
70-79 B
80-89 A
>= 90 S
Note: The percentage is to be rounded off to the next nearest integer.

6) Write a C Program to simulate a simple calculator to perform
      basic arithmetic operations.

7) Write a C Program to check whether a 3-digit number is Armstrong Number or not. Note: An Armstrong Number is one where in cubes of individual digits is equal to the given number.

8) Write a C Program to check whether three numbers entered are Pythagorean Triplets or not.


9) Write a program to read two integer values m and n and to decide and print whether m is multiple of n.

10) Write a program to read three values using scanf statement and print the following results:
     (a)Sum of the values
     (b) Average of the three values
  (c) Largest of the three
(d) Smallest of the three.