0% found this document useful (0 votes)
5 views2 pages

C Program For Lab Report

The document outlines various questions and programming tasks related to logical gates, C programming, and HTML. It includes explanations and diagrams for logical gates, a series of C programming exercises for input validation, mathematical calculations, and array manipulations, as well as instructions for creating web pages with specific HTML elements. The tasks are designed to enhance understanding of programming concepts and web development skills.

Uploaded by

jadejk123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

C Program For Lab Report

The document outlines various questions and programming tasks related to logical gates, C programming, and HTML. It includes explanations and diagrams for logical gates, a series of C programming exercises for input validation, mathematical calculations, and array manipulations, as well as instructions for creating web pages with specific HTML elements. The tasks are designed to enhance understanding of programming concepts and web development skills.

Uploaded by

jadejk123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Lan Questions on Logical Gates

1. Explain all the logical gates with their Logical Diagram, Logical Functions , Truth Table and
Venn Diagram. [ AND, OR NOR, NAND, NOR , XOR , XNOR Gates]

Lab report questions on C Program

1. Write a program to input a number and check whether it is positive, negative, or zero.
2. Write a program to input a number and check whether it is even or odd.
3. Write a program to input two numbers and find which one is greater or if they are equal.
4. Write a program to input three numbers and print the largest of them.
5. Write a program to input a number and check if it is divisible by both 5 and 11.
6. Write a program to input a character and check whether it is a vowel or a consonant.
7. Write a program to input a year and check whether it is a leap year or not.
8. Write a program to input a number and check if it is a prime number (i.e., a number greater than
1 that has no divisors other than 1 and itself).
9. Write a program to input the price of an item and apply a discount based on the price:

 If the price is greater than 1000, apply a 10% discount.


 Otherwise, apply a 5% discount.

10. Write a program that uses a for loop to print all numbers from 1 to N, where N is an integer
provided by the user.
11. Write a program that uses a for loop to calculate the sum of the first N natural numbers.
12. Write a program that uses a for loop to find the factorial of a given number N.

13. Write a program that uses a for loop to print the first N terms of the Fibonacci series.
14. Write a program that uses a while loop to reverse a given number.
15. Write a program that uses a while loop to count the number of digits in a given number.
16. Write a program that uses a for loop to print the multiplication table of a given number N.
17. Write a program that uses a while loop to calculate the sum of digits of a given number.
18. Write a program to print a square pattern of stars (*) where the size of the square (number of
rows and columns) is provided by the user. [ e g .Enter the size of the square: 4]

****
****
****
****
19. Write a program to print the below given pattern
* 54321
1 2 3 4 5 1
** 54321
1 2 3 4 5 12
*** 54321
1 2 3 4 5 123
**** 54321
1234
***** 1 2 3 4 5 54321
12345
20. Write a program to print Floyd’s triangle, a triangular arrangement of numbers where the
numbers are printed consecutively from 1 in each row.
1
23
456
7 8 9 10
21. Write a program to input an array of n elements and find the largest element in the array.
22. Write a program to input an array of n elements and find the smallest element in the array.
23. Write a program to input an array of n elements and calculate the sum of all the elements in the
array.

24. Write a program to input an array of n elements and find the average of the elements.
25. Write a program to input an array of n elements and count how many positive numbers,
negative numbers, and zeros are present in the array.
26. Write a program to input an array of n elements and find the second largest element in the
array.
27. Write a program to input an array of n elements and sort the array in ascending order using the
Bubble Sort algorithm.
28. Write a program to input a matrix of order 3x3 and display them.
29. Write a program to input two matrices of size m x n and calculate their sum. The matrices
should have the same dimensions.
30. Write a program to input two matrices of size m x n and calculate their difference. The
matrices should have the same dimensions.
31. Write a program to input two matrices and multiply them. The number of columns in the first
matrix should equal the number of rows in the second matrix.
32. Write a program to input a matrix and find its transpose. The transpose of a matrix is obtained
by swapping its rows and columns.

Lab Report questions in HTML


1. Create at least 5 web pages that should include the following topic:
a) Heading & Title
b) Tables
c) Ordered and unordered List
d) Images
e) Links
f) Forms
g) CSS
h) -0-

You might also like