Welcome to the Comprehensive C Programming Lab Report Repository, curated by jrTilak. This repository is designed to provide a comprehensive collection of solutions for the C Programming lab assignments, covering various topics and concepts. Whether you are a student studying at Tribhuvan University's Institute of Engineering or an aspiring programmer, this repository is a valuable resource for enhancing your understanding and practical skills in C programming.
Each lab sheet is meticulously prepared and includes a range of exercises and problems for you to solve. The solutions provided in this repository encompass the complete set of requirements, including code samples, lab reports in PDF and DOCX formats with flowchart and algorithm, guides, and detailed explanations. With these resources, you can gain a deeper understanding of each topic and hone your programming skills.
All questions covered in this repo.
The repository follows a structured approach, covering a wide range of topics, including:
- C Programming Fundamentals
- Data Types, Constants, Operators, and Expressions
- Selective Structures (Branching)
- Unformatted and Formatted Input/Output
- Loops
- Functions
- Arrays
- Pointers
- Structures
- Strings
- File Handling
Whether you are starting from scratch or looking to strengthen your knowledge in specific areas, this repository is an invaluable asset. Each lab sheet includes a cover page, title, objectives, algorithm, flowchart, code snippets, program outputs, and a comprehensive discussion and conclusion section. The provided lab sheets adhere to the standards set by the Department of Electronics and Computer Engineering.
If you have any questions, suggestions, or feedback, feel free to reach out to jrTilak, the creator of this repository, at tilakthapa9898@gmail.com. jrTilak is dedicated to ensuring the quality and usefulness of the solutions, and your input is highly valued.
By utilizing this repository, you can enhance your understanding of C programming concepts, improve your problem-solving abilities, and prepare for your final examinations. Explore the lab sheets, delve into the code samples, and unravel the intricacies of C programming with this comprehensive repository.
Note: This repository is not affiliated with Tribhuvan University or the Institute of Engineering. It is an independent initiative by jrTilak to support C programming learners.
- WAP to display hello world.
- WAP to display your name, roll number and address.
- WAP to add two integer variables and print sum.
- WAP to multiply two integer variables and print product.
- WAP to calculate and display the simple interest.
- WAP to calculate the area of the circle.
- WAP to declare integer, float and character variable. Initialize them with certain value and print those values. Also display the size of variables.
- WAP to swap the values of the variable with and without using third variable.
- WAP to calculate the area and volume of a cylinder using pre-processor directive for value of PI.
- WAP to input two numbers from user and display the minimum using conditional operator.
- WAP to display whether a number is even or odd using conditional operator
- What are the output of the following programs:
#include <stdio.h> int main() { int a = 5, b = 9; printf("a = %d, b = %d\n", a, b); printf("a&b = %d\n", a & b); printf("a|b = %d\n", a | b); printf("a^b = %d\n", a ^ b); printf("~a = %d\n", ~a); printf("(b<<2)+(a<<1) = %d\n",(b<<2)+(a<<1)); printf("(b>>1)+(a>>1) = %d\n",(b>>1)+(a>>1)); return 0; }
- WAP to check whether a number is negative, positive or zero.
- WAP to find maximum between three numbers entered by the user.
- WAP to input a character from the user and check whether the character is vowel or consonant.
- WAP to input a character from the user and check whether the character is Alphabet or not. If the character is Alphabet then show whether it is uppercase or lowercase.
- WAP to check whether the year entered by the user is leap year or not.
- WAP to check whether the number entered by the user is divisible by 5 and 11 or not.
- WAP to find the all the roots of a quadratic equation.
- WAP to input two numbers and operator among [ + , - ,* , / ]. If user enters + then the program should perform the addition of the number and display the sum. If user enters – then the program should perform subtraction of number and display the difference and so on for * and /.
- WAP in C to input marks of five subjects C-programming, Physics, Maths, Applied Mechanics and Basic electrical. Display whether the student passed or failed. Take F.M=100 and P.M.=40 For passed students calculate percentage and grade according to following:Percentage >= 90% : A Percentage >=80% : B Percentage >= 70% : C Percentage >= 60% : D Percentage >= 40% : E
- WAP to input a number from user. If user enters a number less than or equal to zero then program should just display the number. If user enters 1 the program should display output as neither prime nor composite, if user enters 2 the program should display output as smallest and only even prime number. If user enters any number greater than 2 the program should check whether the number is prime or not, also if the number is not prime the program should display whether it is even or odd.
- WAP to get your name, address and display using unformatted I/O.
- WAP to get a character form the user using unformatted I/O and display the ASCII value of the entered character.
- WAP to display the output as (take a=15, b=20.43, c=35):
A = 15|15 | 15|15 | 15|15 | 15|15 | 15|15 | B = 20.43|20.43 | 20.43|20.43 | 20.43|20.43 | 20.43|20.43 | 20.43|20.43 | C = 35|35 | 35|35 | 35|35 | 35|35 | 35|35 |
- WAP to display the output as below using formatted I/O [take char a[]=”I Love Nepal”].
I I L I Lo I Lov I Love I Love N I Love Ne I Love Nep I Love Nepa I Love Nepal
- WAP to read 10 numbers from user and find their sum and average.
- WAP to display the multiplication table of integer given by the user.
- WAP to input two integer values from the user and print the even number between the range of integers. Also count the even number and display the count as well [Hint: if user enters 10 and 100. The program should print and count even numbers between 10 and 100].
- WAP to display sum of series: 1 + 1/2 + 1/3 + 1/4 + 1/5 ... 1/n
- WAP to display sum of series: 1 + 1/2! + 1/3! + 1/4! + 1/5! ... 1/n!
- WAP to display sum of series: x + x2/2! + x3/3! + x4/4! + x5/5! ... xn/n!
- WAP to find the value cos(x) without using cos(x) library function.
- WAP to display weather a number is Armstrong or not.
- WAP to display the first n terms of Fibonacci series.
- WAP to display the number in reverse order.
- WAP to check whether a number is a palindrome or not.
- WAP to find HCF and LCM of two numbers.
- WAP to print the following patterns
Pattern 1:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Pattern 2:
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Pattern 3:
*
***
*****
*******
*********
Pattern 4:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
Pattern 5:
1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1
Pattern 6:
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5