Ilovepdf Merged
Ilovepdf Merged
NET with Rich Text Box and ComboBox for formatting text
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles
ComboBox1.SelectedIndexChanged
Dim selectedFormat As String = ComboBox1.SelectedItem.ToString()
class Program
{
static void Main(string[] args)
{
int choice;
do
{
Console.WriteLine("Menu:");
Console.WriteLine("1. Calculate Factorial");
Console.WriteLine("2. Generate Fibonacci Series");
Console.WriteLine("3. Check for Prime Number");
Console.WriteLine("4. Exit");
Console.Write("Enter your choice: ");
choice = Convert.ToInt32(Console.ReadLine());
switch (choice)
{
case 1:
CalculateFactorial();
break;
case 2:
GenerateFibonacciSeries();
break;
case 3:
CheckPrimeNumber();
break;
case 4:
Console.WriteLine("Exiting...");
break;
default:
Console.WriteLine("Invalid choice. Please try again.");
break;
}
} while (choice != 4);
}
Console.WriteLine();
}
if (num == 0 || num == 1)
{
Console.WriteLine("{0} is not a prime number.", num);
return;
}
if (flag == 0)
{
Console.WriteLine("{0} is a prime number.", num);
}
else
{
Console.WriteLine("{0} is not a prime number.", num);
}
}
}
4. Write a program to calculate the area of a circle (VB.NET and C#).
*VB.NET
Module Module1
Sub Main()
Dim radius As Double = InputBox("Enter the radius of the circle:")
End Module
*C#
using System;
class Program
{
static void Main(string[] args)
{
Console.Write("Enter the radius of the circle: ");
double radius = Convert.ToDouble(Console.ReadLine());
Module Module1
Sub Main()
Dim strInput As String = InputBox("Enter a string to check for palindrome:")
If IsPalindrome(strInput) Then
Console.WriteLine("{0} is a palindrome.", strInput)
Else
Console.WriteLine("{0} is not a palindrome.", strInput)
End If
Console.ReadLine()
End Sub
End Module