You are on page 1of 3

B.

Tech 1
st
Year (Aero, Civil, CSE, E&Ec, Electrical, Mechanical, Metta, Production), July-Dec 2014
Computer Programming (Basic)
Practical Assignment 1
Topics Covered: Data types, Variables, Constants, operators

• Write a program that will print your mailing address in the following form:
First line : Name
Second line : Door No, Street
Third line : City, Pin code
• Modify the above program to provide border lines to the address.
• Given the radius of a circle, write a program to compute and display its area. Use a symbolic
constant to define the π value and assume a suitable value for radius.
• Given two integers 20 and 10, write a program to add these two numbers and find the difference
of these two numbers and then display the sum and difference in the following form:
20 + 10 = 30
20 – 10 = 10
• Given the values of three variables a, b, and c, write a program to compute and display the value
of x, where
X = a/ (b – c)
• Write a program to accept an unsigned integer number from the user and display its equivalent
octal and hexadecimal number
• Write a program to print the character as shown below
J
J
J
• Write a program to accept a character and display its ASCII code.
• Write a program to find simple interest and maturity amount
• A year approximately consists of 3.156 x 10
7
seconds. Write a C program that accepts your age in
years and convert it into equivalent number of seconds.
• Write a program to swap two numbers:
• Using temporary variable
• Without using temporary variable


B.Tech 1
st
Year (Aero, Civil, CSE, E&Ec, Electrical, Mechanical, Metta, Production), July-Dec 2014
Computer Programming (Basic)
Practical Assignment 2
Topics Covered: Data types, Variables, Constants, operators
• Write a program to find GCD of two numbers
• Write a program to find LCM of two numbers
• Mr. X deposit Rs 5000 in bank Y. The bank gives compound interest of 3% annually. Write a C
program to determine the amount in Mr X account at the end of n years. (value is n is taken as
input from the user)
• Write a program to read the price of an item in rupees and print the output in paisa.
• Write a program to determine whether a given number is odd or even and print the message
corresponding to the number.
• Write a program to find the number of bytes occupied by the number 235L.
• Write a program to find the number of all and sum of all integers that are greater than 100 and
less than 200 that are divisible by 7.
• Write a program to compute the average of the ten numbers 1, 4, 9, ..., 81, 100, that is, the
average of the squares of the numbers from 1 to 10.
• Write a program to print the first 7 positive integers and their factorials.
• Write a program to convert 27
0
from degrees to Fahrenheit (F) to degrees Celsius (C) using the
formula: C= (F-32) / 1.8
• Write a program to evaluate the polynomial shown: 3x
3
- 5x
2
+ 6 for x=2.55
• Write a C program to find 1’s and 2’s compliment of a number entered by the user. (1’s
compliment of a binary number is found by complimenting each bit of binary number. 2’s
compliment of a binary number is found by adding 1 to the 1’s compliment of binary number).
• Write a C program to multiply a given number with 2
n
without using a multiplication operator.
Value of n will be entered by the user.