├── README.md ├── if-else.c ├── input-output.c ├── math.c ├── operators.c ├── switch.c └── ternary.c /README.md: -------------------------------------------------------------------------------- 1 | # c-programming-assignments 2 | 3 | ## Input-Output assignments 4 | 5 | Write code for all the following assignments in input-output.c file 6 | 7 | 1. Write a program to print your name and details 8 | 2. Write a program that will display the size of int, float, double, char data type. 9 | 3. Write a program to find a character of ASCII value. 10 | 4. Write a program to find ASCII value of a character. 11 | 5. Write a program that convert lowercase letter to uppercase using library function. 12 | 6. Write a program that convert uppercase letter to lowercase using library function. 13 | 7. Write a program that convert lowercase letter to uppercase without using library function. 14 | 8. Write a program that convert lowercase letter to uppercase without using library function. 15 | 9. Write a program that convert decimal to octal. 16 | 10. Write a program that convert octal to decimal. 17 | 11. Write a program that convert decimal to hexa-decimal. 18 | 12. Write a program that convert hexa-decimal to decimal. 19 | 13. Write a program that convert octal to hexa-decimal. 20 | 14. Write a program that convert hexa-decimal to octal. 21 | 22 | ## Operators assignments 23 | 24 | Write code for all the following assignments in operators.c file 25 | 26 | 1. Write a program that add 2 integers/floating point number. 27 | 2. Write a program that add, subtract, multiply, divide 2 integers/floating point number. 28 | 3. Write a c program that calculate the area of a triangle. 29 | 4. Write a c program that calculate the area of a triangle, 3 sides length are given. 30 | 5. Write a C program that calculate the area of a rectangle. 31 | 6. Write a C program that calculate the area of a circle. 32 | 7. Write a C program that convert the Celsius temperature to Fahrenheit. 33 | 8. Write a C program that convert the Fahrenheit temperature to Celsius. 34 | 9. Write a C program that swaps 2 numbers. 35 | 36 | ## assignments 37 | 38 | Write code for all the following assignments in math.c file 39 | 1. Write a program that read any integer and display its absolute value. 40 | 2. Write a program that read any number and display its square root. 41 | 3. Write a program that read any number x and display log(x). 42 | 4. Write a program that read any number x and display log10(x). 43 | 5. Write a program that read any number x and display its square root. 44 | 6. Write a program that read any number x and display e to the power x. 45 | 7. Write a program that read two numbers (x, y) and display the value of xy. 46 | 8. Write a program that read any angle t and display sin (t). 47 | 9. Write a program that read any angle t and display cos (t). 48 | 10. Write a program that read any angle t and display sec (t). 49 | 11. Write a program that read any angle t and display tan (t). 50 | 12. Write a program that read any angle t and display cosec (t). 51 | 13. Write a program that read any angle t and display cot (t). 52 | 53 | ## if - else if- else assignments 54 | 55 | Write code for all the following assignments in if-else.c file 56 | 1. Write a program that read mark and display pass or fail. 57 | 2. Write a program that read mark and display result in grade. 58 | 3. Write a program to check a number even or odd. 59 | 4. Write a program that read mark and display pass or fail. 60 | 5. Write a program that read mark and display result in grade. 61 | 6. Write a program to check a number even or odd. 62 | 7. Write a program to check a number positive or negative. 63 | 8. Write a program that read two numbers and display maximum. 64 | 9. Write a program that read two numbers and display minimum. 65 | 10. Write a program that read three numbers and display maximum. 66 | 11. Write a program that read three numbers and display minimum. 67 | 12. Write a program that read three numbers and display medium. 68 | 13. Write a program that read three numbers (a, b, c) and determine the roots of the quadratic equation. 69 | 14. Write a program that read any year and display leap or not. 70 | 15. Write a program that read any letter and display vowel or consonant. 71 | 16. Write a program that read any letter and display its uppercase or lowercase. 72 | 73 | ## Ternary assignments 74 | 75 | Write code for all the following assignments in ternary.c file 76 | 1. Write a program that read mark and display pass or fail. 77 | 2. Write a program to check a number even or odd. 78 | 3. Write a program that read two numbers and display maximum. 79 | 4. Write a program that read two numbers and display minimum. 80 | 5. Write a program that read three numbers and display maximum. 81 | 6. Write a program that read three numbers and display minimum. 82 | 7. Write a program that read three numbers and display medium. 83 | 84 | ## switch assignments 85 | 86 | Write code for all the following assignments in switch.c file 87 | 1. Write a program that read a digit and display by its spelling. 88 | 2. Write a program that read a year and display leap year or not. 89 | 3. Write a program that read any letter and display vowel or consonant. 90 | 4. Write a program that read any number and display its Roman number. 91 | 92 | 93 | -------------------------------------------------------------------------------- /if-else.c: -------------------------------------------------------------------------------- 1 | // 1. Write a program that read mark and display pass or fail. 2 | // Add the solution here 3 | 4 | // 2. Write a program that read mark and display result in grade. 5 | // Add the solution here 6 | 7 | // 3. Write a program to check a number even or odd. 8 | // Add the solution here 9 | 10 | // 4. Write a program that read mark and display pass or fail. 11 | // Add the solution here 12 | 13 | // 5. Write a program that read mark and display result in grade. 14 | // Add the solution here 15 | 16 | // 6. Write a program to check a number even or odd. 17 | // Add the solution here 18 | 19 | // 7. Write a program to check a number positive or negative. 20 | // Add the solution here 21 | 22 | // 8. Write a program that read two numbers and display maximum. 23 | // Add the solution here 24 | 25 | // 9. Write a program that read two numbers and display minimum. 26 | // Add the solution here 27 | 28 | // 10.Write a program that read three numbers and display maximum. 29 | // Add the solution here 30 | 31 | // 11.Write a program that read three numbers and display minimum. 32 | // Add the solution here 33 | 34 | // 12.Write a program that read three numbers and display medium. 35 | // Add the solution here 36 | 37 | // 13. Write a program that read three numbers (a, b, c) and determine the roots of the quadratic equation. 38 | // Add the solution here 39 | 40 | // 14. Write a program that read any year and display leap or not. 41 | // Add the solution here 42 | 43 | // 15. Write a program that read any letter and display vowel or consonant. 44 | // Add the solution here 45 | 46 | // 16. Write a program that read any letter and display its uppercase or lowercase. 47 | // Add the solution here 48 | -------------------------------------------------------------------------------- /input-output.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anisul-Islam/c-programming-assignments/d5f4d009c9941b7dcd8ce79ee6b356cc0dd7b010/input-output.c -------------------------------------------------------------------------------- /math.c: -------------------------------------------------------------------------------- 1 | 2 | 1. Write a program that read any integer and display its absolute value. 3 | // Add the solution here 4 | 5 | 2. Write a program that read any number and display its square root. 6 | // Add the solution here 7 | 8 | 3. Write a program that read any number x and display log(x). 9 | // Add the solution here 10 | 11 | 4. Write a program that read any number x and display log10(x). 12 | // Add the solution here 13 | 14 | 5. Write a program that read any number x and display its square root. 15 | // Add the solution here 16 | 17 | 6. Write a program that read any number x and display e to the power x. 18 | // Add the solution here 19 | 20 | 7. Write a program that read two numbers (x, y) and display the value of xy. 21 | // Add the solution here 22 | 23 | 8. Write a program that read any angle t and display sin (t). 24 | // Add the solution here 25 | 26 | 9. Write a program that read any angle t and display cos (t). 27 | // Add the solution here 28 | 29 | 10. Write a program that read any angle t and display sec (t). 30 | // Add the solution here 31 | 32 | 11. Write a program that read any angle t and display tan (t). 33 | // Add the solution here 34 | 35 | 12. Write a program that read any angle t and display cosec (t). 36 | // Add the solution here 37 | 38 | 13. Write a program that read any angle t and display cot (t). 39 | // Add the solution here 40 | 41 | -------------------------------------------------------------------------------- /operators.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anisul-Islam/c-programming-assignments/d5f4d009c9941b7dcd8ce79ee6b356cc0dd7b010/operators.c -------------------------------------------------------------------------------- /switch.c: -------------------------------------------------------------------------------- 1 | 1. Write a program that read a digit and display by its spelling. 2 | // add the solution here 3 | 4 | 2. Write a program that read a year and display leap year or not. 5 | // add the solution here 6 | 7 | 3. Write a program that read any letter and display vowel or consonant. 8 | // add the solution here 9 | 10 | 4. Write a program that read any number and display its Roman number. 11 | // add the solution here 12 | -------------------------------------------------------------------------------- /ternary.c: -------------------------------------------------------------------------------- 1 | 2 | 1. Write a program that read mark and display pass or fail. 3 | // add the solution here 4 | 5 | 2. Write a program to check a number even or odd. 6 | // add the solution here 7 | 8 | 3. Write a program that read two numbers and display maximum. 9 | // add the solution here 10 | 11 | 4. Write a program that read two numbers and display minimum. 12 | // add the solution here 13 | 14 | 5. Write a program that read three numbers and display maximum. 15 | // add the solution here 16 | 17 | 6. Write a program that read three numbers and display minimum. 18 | // add the solution here 19 | 20 | 7. Write a program that read three numbers and display medium. 21 | // add the solution here 22 | --------------------------------------------------------------------------------