Introduction to Computers Programming (ICP-132)

Main Page

Assignment 01
Assignment 02
Assignment 03
Assignment 04
Assignment 05
Assignment 06
Assignment 07
Assignment 08
Assignment 09
Assignment 10
Assignment 11
Assignment 12
Assignment 13

Coding rules (pdf)
Sample code
Prob: Set 1
Prob: Set 2
Compiler options
Submission

Forum
Teaching Assistants
Links
Trivia

Assignment 2

Demonstrate a program that can do the following tasks:

a. Swap two numbers without using a third variable.
b. Find factorial of a number.
c. Multiply two numbers without using '*'
d. Print first n (n>2) Fibonacci (Fib) numbers, using only three variables.
     ( Fib is defined as: Fib(i)=Fib(i-1)+Fib(i-2) with Fib(0)=0 and Fib(1)=1 )
e. Using simple loops and without using inbuilt functions or math.h, find the number of bytes allocated by the compiler for:
     (i) short int, (ii) int, and (iii) long int


PS: The program should be coded in both C and C++.