NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Qs 1
static void Main(string[] args)
{
Console.WriteLine("enter first name");
string fname = Console.ReadLine();
Console.WriteLine("enter last name");
string lname = Console.ReadLine();
Console.WriteLine(lname+ " " +fname);
}
Qs 2
public static void Main(string[] args)
{
Console.WriteLine("Enter string");
string s = Console.ReadLine();
string re = "";
for (int i= s.Length-1; i>=0; i--)
{
re = re + s[i];
}
if (s == re)
Console.WriteLine("Palindrome");
else
Console.WriteLine("not palindrome");
}

Q3
static void Main(string[] args)
{
System.Console.WriteLine("Enter number");
string s = Console.ReadLine();
string p = "";
for(int i=0; i<3; i++)
{

p= p+(s[i]);


}
p = p + " ";
for(int i=3; i<s.Length; i++)
{
p = p + s[i];
}
Console.Write(p);

}

Q4

static void Main(string[] args)
{

int[] arr = {1,2,3,4,5};

for(int i =0 ; i < 5; i++)
{
Console.Write(arr[i] * arr[i]+" ");

}
}



02/02/23
Qs 1
public static void Main()
{
string[] arr = new string[] { "0", "true", "1", "2", "null", "3", "void" };
for (int i = 0; i < 7; i++)
{

String s = arr[i];
bool isnum = true;
for (int j = 0; j < s.Length; j++)
{
if (s[j] > ''0' && s[j]<='9'')
{
continue;

}
else
isnum = false;
}
}


}
if(isnum==true)
Console.WriteLine(s);

}
Qs 2
public static void Main()
{
int i, j;
int[] arr = new int[] { 1, 2, 3, 3, 4, 2, 5};
for ( i = 0; i < 7; i++)
{
for ( j = i+1; j < 7; j++)
{

if (arr[i] == arr[j])
p = i;
{
Console.WriteLine(arr[i] + " ");
}
}


}
}

Qs 3
public static void Main()
{
int[] arr = new int[] { 1, 2, 4 };
int[] arr2 = new int[] { 1, 2, 3 };
bool j = true;
if (arr.Length == arr2.Length)
{
for (int i = 0; i < 3; i++)
{
if (arr[i] != arr2[i])
{
j = false;
break;
}
}
}
else
j = false;
Console.WriteLine(j);


}
Q4
public static void Main()
{
int a=0, wrd = 1, c=0;
string s = "She sails sea shells on the sea shore";
while(a<=s.Length-1)
{
if (s[a] == " " || s[a] == "t")
wrd++;
a++;
}
Console.WriteLine("no of words is"+ wrd);
foreach (char c in s)
c++;
Console.WriteLine(c);
}
03-02-2023
class Person
{
public void f1()
{
Console.WriteLine("From person 1");


}
public void f2()
{
Console.WriteLine("From person 2");


}
}

class Employee:Person
{
public void f3()
{
Console.WriteLine("From person 3");


}
public void f4()
{
Console.WriteLine("From person 4");


}

}
class Manager:Employee
{
public void f5()
{
Console.WriteLine("From person 5");


}
public void f6()
{
Console.WriteLine("From person 6");


}
}
public static void Main(string[] args)
{
Manager obj = new Manager(); ;
obj.f1();
obj.f2();
obj.f3();
obj.f4();
obj.f5();
obj.f6();
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.