0% found this document useful (0 votes)
4 views

Assignemnt

Uploaded by

lpu.online.bca
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignemnt

Uploaded by

lpu.online.bca
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Write a C program to demonstrate the programming environment in C.

Explain each basic entity


required to build a program including the compilation and run process.

2. Write a C program to demonstrate the use of printf() and scanf() statements to read and print
values of variables of different data types.

3. Write a C program to demonstrate the use of assignment operator.

4. Write a C program to displays the size of every data type.

5. Write a C program to show the use of relational operators.

6. Write a C program to illustrate the use of unary prefix/ postfix increment and decrement
operators.

7. Write a C program to find the largest of two numbers using ternary operator.

8. Write a C program to print the ASCII value of a character.

9. Write a C program to read a character in upper case and then print in lower case.

10. Write a C program to convert degrees Fahrenheit onto degree Celsius.

11. Write a C program to convert a floating-point number into the corresponding integer and vice
versa.

Assignement-1

12. Write a C program to perform addition, subtraction, division, and multiplication on two integers
and two floating point numbers.
13. Write a C program to swap two numbers using and without using a temporary variable.
14. Write a C program to calculate the distance between two points.
15. Write a C program to calculate the area of a triangle using Hero’s formula.

1. Write the C programs to demonstrate the use of following operators:

 Relational Operators

 Logical Operators
 Shorthand Assignment

 Unary Operators

 Conditional Operators

 Bitwise Operators

 Comma Operator

2. Write a C program to show the use of logical operators.

3. Write a C program to show whether a person is eligible to vote.

4. Write a C program to show the use of isalpha(), isdigit(), isprint() and isspace() functions with if.

5. Write a C program to enter number from 1 to 7 and display the corresponding day of the week
using switch case statement.

6. Write a C program to print 20 horizontal asterisks (*) using while loop.

7. Write a C program to calculate the sum of numbers from m to n using while loop.

8. Write a C program to display the square and cube of first n natural numbers using do-while loop.

9. Write the C programs to print following patterns using for loop:

(i) (ii) (iii) (iv)

* 1

********** ** 12 1

********** *** 123 121

********** **** 1234 12321

********** ***** 12345 1234321

********** 123454321

10. Write a program in C using for loop to calculate the factorial of a number.

11. Write a program in C to print the reverse of a number.

12. Write a program in C to classify a number as prime or composite.


13. Write the programs to demonstrate the use of break, continue and goto statements.

14. Write a C program to enter any character and then determine whether it is a vowel or not using
if-else.
15. Write a C program to find whether a given year is a leap year or not considering also the century
year condition using if-else.
16. Write a C program using if-else-if, to calculate tax, given the following conditions:

 Income < = 150000, then no tax.

 Income > 150000 and <= 300000, then charge 10% tax.

 Income > 300000 and <= 500000, then charge 20% tax.

 Income > 500000, then charge 30% tax.

17. Write a C program to find the greatest of three numbers using && and
if-else-if.

You might also like