1
1
Liquid Layout:- A liquid layout adjusts its width and size based on the browser window.
It’s designed to be responsive and fill the space on the screen proportionally. This is
common in responsive web design.
Key Features: Relative Units: Utilizes relative units like percentages and ems to
express element sizes, allowing them to scale proportionally with the container's
dimensions.
Flexible Box Model: Leverages the CSS Flexible Box Model to achieve fluid
layouts by distributing available space among elements based on their flex
properties.
Responsive Design: Naturally adapts to various screen sizes by dynamically
adjusting element sizes and positions.
Di erence Between:
Logical operators:
o && (logical AND)
o || (logical OR) * (logical NOT)
Bitwise operators:
Assignment operators:
Content Page:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="WebApplication1.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
This is the content page.
</asp:Content>
Q.10 What is Exception Handling? Explain with proper example.
Exception handling in C# is a mechanism for handling errors that occur during program
execution. It helps prevent your program from crashing and provides a way to gracefully
recover from unexpected situations.
Example:
try
{ int numerator = 10;
int denominator = 0;
int result = numerator / denominator;
Console.WriteLine("Result: " + result);}
catch (DivideByZeroException ex)
{Console.WriteLine("Error:
Division by zero.");
Console.WriteLine(ex.Message);}
finally
{Console.WriteLine("Finally block executed.");}
In this example, the try block contains the code that might throw an exception (dividing
by zero). If an exception occurs, the catch block is executed, and the error message is
displayed. The finally block is always executed, regardless of whether an exception
occurred.
Q.11 Write a note on Type Conversion in C#.
Type conversion in C# refers to the process of converting a value from one data type to
another. There are two types of conversion: implicit and explicit.
Implicit conversion: This occurs automatically when a value can be safely
converted to a larger data type without losing information. For example, an int
can be implicitly converted to a double.
Explicit conversion: This requires a cast operator to explicitly convert a value to
a smaller data type. This can potentially lead to loss of precision or data. For
example, a double can be explicitly converted to an int, but any decimal part will
be truncated.
Example:
|| int x = 10; || double y = x; // Implicit conversion || int z = (int)y; // Explicit conversion ||