Sie sind auf Seite 1von 5

C-LANGUAGE ASSIGNMENT

PRINTF AND SCANF [UNFORMATED INPUT/OUTPUT]

1. Write a program to convert days to months and days [Logic months=days/30 days=days%30?
2. Write a program to swap the value without using two values?
3. Write a program to find area of a square?
4. Write a program to find the Simple interest?
5. Write a program to convert Centigrade to Fahrenheit?
6. Write program, which accepts a key from the user, print the ASCII value?
7. Write a program to find the area of the rectangle?
8. Write a program, which accepts the data from the user and the print, the octal and hex value?
9. Write a program, which accepts the basic salary from the user and calculate the gross salary
when the DA is 40% of basic rent is 20% of basic.
10. The distance between the two cities (in KM) is input through the keyboard. Write a program to
convert and print the distance in meters, feet, inches and centimeter?
[1km=1000m, 1 feet=.3048,1 inch=2.54,cm=.01]

IF STATEMENTS [CONDITIONAL OPERATORS]

1. Write a program, which accepts a value form, the user and print the greatest number?
2. Write a program to find the grates of three different numbers?
3. Write a program which accepts a character from the user and the find the character you have
pressed is an alphabet, number or special character? [65 to 90 capitals] [97 to 122 small][48 to 57
numbers.
4. Write a program, which accepts CP and SP of an item and display profit and profit percent loss
percent or no profit and no loss?
5. Write a program which accepts the marks of the three subjects and print the division if the
student passed in all the subject with percentage marks, total and the marks .The pass marks is
above 35
6. Write a program, which accepts a number form, the user and print the even or odd.
7. Write a program which accepts the values of a, b and c from the user and find whether a, b, c
can form a triangle? [Logic (a+b)>c and (b+c)>a and (c+a)>b
8. Write a program to calculate the electricity bill, which accepts the previous reading and the
current reading .If the units, is more then 100 then 1.50 more then 200 2.00 else 1.00.
9. Write a program, which the Indian currency format from the user and convert them into us
dollars, Singapore and Malaysia.
10. A manufacturer offered a cash discount on the total purchasing of items and offered the cash
discount as per the given range if the amount more then 5000 then 10% or more then 10000 20%
discount else no discount .calculate the discount value and the purchasing value as per the pno,
cost and the total quantity entered by the user.
CASE CONTROL STATEMENT

1. Write a program for simple calculator i.e. addition, multiplication, subtraction,


division?
2.

3. Write a program for simple calculator i.e. addition, multiplication, subtraction,


division? Using math operator ie ‘+’ – etc
4. Write program, which accepts a key from the user and print the key u pressed is
vowel or consonant?
5. Write a program, which accept the weekday number and print the weak day in
character i.e. Sunday, Monday etc.
6. Write a program to calculate the electricity bill depends upon the code value?

Categories...........................................Code
Domestic................................................1
Industries...............................................2

Domestic
Units > 100 1.50/-
Units>200 2.00/-
Default 1.00

Industries
Units > 100 2.00/-
Units>200 2.50/-
Default 1.50

7.Write a program to calculate the income tax depend upon the grade of the employee.

Grade..............................................Tax%
A...................................................10%
B....................................................8%
C...................................................13%
Enter the basic hra and da of the employee and deduct the tax grade wise?

8.Write a program, which accepts the country code, and change into Indian currency
format.

Country.............................................code
U.S.A...................................................1
U.A.E..................................................2
Singapore...............................................3
Code 1 value is 35/- and code 2 values is 45 and code 3 value is 50/-

FOR LOOP STATEMENTS

1.Write a program, which accepts a number, and print the table of 10?
2.Write a program, which accepts a number form, the user and print the table of 10 from
the starting number to till the end?
3.Write a program, which accept a number from the user and print the factorial number?
4. Write a program to print the ASCII?
5. Write a program to print the A to Z?
6.Write a program to generate the fibonaci series?
7.Write a program to generate Pascal’s triangle?

8.Write a program to generate Prime numbers form 1 to 10 ?


9.Write a program Leap years from 1 to 50?
10.Write a program to calculate simple interest for 5 years?

WHILE LOOP

1.Write a program, which accepts a number, and print the reverse number?
2.Write a program which find the sum of the digit Eg: 123=5
3.Accept a number and display the equivalent binary code?
4.Write a program to print the square of even number and the cube of odd number?
5.Write a program to generate the number is palindrome or not?
6.Write a program, which accepts a value, the factorial value of the number?

FUNCTIONS

MATH FUNCTIONS PROGRAM

1.Write a program to convert binary to decimal


2.Write a program to convert decimal to binary
3.Write a program to convert octal to decimal
4.Write a program to determine the area of triangle using the formula [area=sort(s*(s-
a)*(s-b)*(s-c).
5.Write a program to find the roots of the quadratic equation? [D=b2-4ac]
6.Write a program to find the compound interest?
STRING FUNCTIONS

1.Write which accepts a string the from the user and print the palindrome or not series?
2.Write a program to find the greatest string from the given string?
C type function

1.Write a program to accepts which accepts a character form the user and print the key
you pressed in a number and character or special character.
User Defined functions:

1.Write a program to find the sum of two numbers?


2.Write a program to swap the number?
3.Write program to find the factorial value using recursion function?

ARRAYS:

1.Write a program, which accepts the 10 different numbers from the user, and print the
sum of the number?
2.Write a program, which accepts a 5 different numbers from the user amd print in
ascending order?
3.Write a program, which accepts 5 different numbers from the user and accepts a number
from outside and check the number is present in the list?
4.Write a program which accepts the values from the user eg a [5]={10,20,30,40,50} and
print the value is present or not?
5.Write a program, which accepts the 5 different age from the user and find number of
kids, childrens, adult, and oldage.
6.Write a program, which accepts to print the matrix?
7. Write a print the addition of matrix?
8.Write a program to print he multiplication of the matrix
9.Write a program to find the biggest and the smallest value of the number?
10.Write a program for deleting the number form the list.

STRING

1.Write a program to print the string in vertical order?


2.Write a print, which accepts a string, the form the user and find the length of the string?
3.Write a program, which accept a string and copy the string into another?
4.Write a program, which accepts a string and reverse?
5.Write a program, which accept a string from the user and find the number of vowels and
consonant present?
6.Write a program, which accepts a string from the user, and count the number of words
present in the string?
7.Write a program, which accepts the two strings and join the two strings?
8.Write a program, which accepts a string, and find palindrome or not?
MACROS:

1.Write a program to find the greatest value?


2.Write a program which accept a value and find the value is in the range
3.Write a program, which accepts the cp and sp, and find the profit,loss or no profit or no
loss?
4.Write a program to calculate the circumference of a circle, volume of the cylinder by
taking the PI value as a macros
5.Write a program to find the positive or negative using the macro?

POINTERS:

1.Write a program to interchange the value using the function and pointer?
2.

Das könnte Ihnen auch gefallen