Taps
Taps
:-1
Date:- / /11
Write a program to read two strings from the keyboard using the ReadLine statements and display them on one line using two Write statements.
Program:using System; class sample1 { public static void Main(string []args) { string s; Console.WriteLine("Enter your name"); s = Console.ReadLine(); Console.WriteLine("Hello"+s); Console.WriteLine("what is your age"); s = Console.ReadLine(); Console.WriteLine("you are looking nice at"+ s); } }
Output:-
Assignment No.:-2
Date:- /
Write a program to perform the following tasks >declare two variables x and y as float type variables >declare m as an integer variable >Assign the sum of x and y to m >display the value of m Comment on the output Program:using System; class sample2 { public static void Main() { float x, y; int m; x = 75.86F; y = 43.48F; m = (int)(x+y); Console.WriteLine("The sum of x And y is " + m); } }
/11
Output:-