0% found this document useful (0 votes)
9 views5 pages

Unit 1

This document contains a comprehensive set of questions and tasks related to ASP.NET and C#. It covers topics such as CLR, FCL, data types, operators, control statements, loops, and object-oriented programming concepts. The questions are categorized into 2-mark and 7-mark sections, focusing on definitions, explanations, and coding examples.
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)
9 views5 pages

Unit 1

This document contains a comprehensive set of questions and tasks related to ASP.NET and C#. It covers topics such as CLR, FCL, data types, operators, control statements, loops, and object-oriented programming concepts. The questions are categorized into 2-mark and 7-mark sections, focusing on definitions, explanations, and coding examples.
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

Unit – 1 ASP.

NET
2 mark

1. What is CLR in C#?

2. List any two responsibilities of CLR.

3. What does FCL stand for?

4. Name two namespaces commonly used from the FCL.

5. Which component of .NET provides memory management?

6. How does CLR help in language interoperability?

7. Is FCL the same as .NET class libraries? Justify.

8. What is the purpose of JIT in CLR?

9. Define CTS and mention its role in CLR.

10. What is the difference between CLR and FCL in .NET?

11. What is a primitive type in C#?

12. Name any four primitive data types in C#.

13. Define a variable in C#.

14. What is the default value of an int variable in C#?

15. How do you declare a constant variable in C#?

16. Write a sample declaration of a float variable.

17. What is the difference between float and double?

18. What is the size of a bool in C#?

19. What is type inference in C#?

20. Give an example of using the var keyword in C#.

21. What is the purpose of the char data type?


22. Is string a primitive type in C#?

23. What is the range of the byte data type?

24. How do you assign a Unicode character to a char variable?

25. What will be the output of:

int x = 10; [Link](x);

26. What are arithmetic operators in C#? List any four.

27. Define relational operators with an example.

28. What is the purpose of the logical AND (&&) operator in C#?

29. Differentiate between = and == operators.

30. What is a conditional statement? Name two types in C#.

31. What is the use of the ternary (?:) operator in C#?

32. Give the syntax of an if statement in C#.

33. Write a short code snippet to demonstrate the switch statement.

34. What is short-circuit evaluation in C#?

35. List any two assignment operators other than =.

36. Name any two types of loops in C#.

37. Write the syntax of a for loop in C#.

38. What is the difference between while and do-while loop?

39. What is the use of the break statement inside a loop?

40. What is an infinite loop? Give an example.

41. Define a class and an object in C#.

42. What keyword is used to create an object in C#?

43. Write a simple class declaration with one method.

44. How do you access class members using an object?

45. What is the difference between a class and an object?


7 mark

1. How does the CLR manage resources using Garbage Collection? Explain the process with stages.

2. Explain primitive types in C# with examples of each.

3. Discuss different data types available in C#.

4. Classify them as value types and reference types.

5. Explain the difference between int, float, and double with sample code.

6. Describe how variables are declared and initialized in C#. Write a program to declare

variables of different types.

7. Differentiate between value types and reference types in C# with examples.

8. Write a C# program to declare and display values of all primitive types.

9. What is type inference in C#? Explain with examples using the var keyword.

[Link] a C# program that accepts integer and float input from the user and displays them.

[Link] the rules for naming variables in C#. Give valid and invalid examples.

[Link] and contrast const, readonly, and var keywords in C#.

[Link] a program that demonstrates the use of bool, char, int, and double. Explain your

code.

[Link] how memory is allocated for value and reference types. How does this impact

program performance

15. Explain different types of operators in C# with examples (arithmetic, relational, logical, assignment).

16. Differentiate between if, else if, else, and switch statements using examples.
17. Write a C# program to check whether a number is positive, negative, or zero using conditional

statements.

18. Discuss logical operators (&&, ||, !) with truth table and examples.

19. Explain the use of conditional/ternary operator (?:) with a program.

20. Write a program to find the greatest of three numbers using if-else statements.

21. What is a switch statement? Write a program to display the day of the week using switch.

22. How do nested if statements work in C#? Write a program and explain the flow.

23. Write a program to demonstrate the use of arithmetic and assignment operators together.

24. Describe operator precedence and associativity in C#. Provide a table and example code

25. Explain different types of operators in C# with examples (arithmetic, relational, logical, assignment).

26. Differentiate between if, else if, else, and switch statements using examples.

27. Write a C# program to check whether a number is positive, negative, or zero using conditional

statements.

28. Discuss logical operators (&&, ||, !) with truth table and examples.

29. Explain the use of conditional/ternary operator (?:) with a program.

30. Write a program to find the greatest of three numbers using if-else statements.

31. What is a switch statement? Write a program to display the day of the week using switch.

32. How do nested if statements work in C#? Write a program and explain the flow.

33. Write a program to demonstrate the use of arithmetic and assignment operators together.

34. Describe operator precedence and associativity in C#. Provide a table and example code.

35. Explain different types of loops in C# with syntax and examples (for, while, do-while, foreach).

36. Write a program using a for loop to print the multiplication table of a number.

37. Discuss the working of a do-while loop with a suitable example.

38. Write a program to calculate the sum of first n natural numbers using a while loop.

39. Describe break and continue statements in loops with code examples.
40. Define class and object in C#. Write a simple program to create and use objects.

41. Explain how to declare, instantiate, and access members of a class in C#.

42. Write a program in C# to create a class Student with members name and marks. Create an object and

display details.

43. Discuss the concept of object-oriented programming in C# with focus on classes and objects.

44. What happens in memory when an object is created in C#? Explain with example and diagram

(optional).

You might also like