Programming in c#.pdf - Programming in c Course code:ITA 6002 LAB:L57 58 Name:Joyoti Mondal Register no:19MCA0053 CYCLE SHEET:1 Date PRACTICE PROBLEM:1

Programming in c#.pdf - Programming in c Course code:ITA...

This preview shows page 1 - 8 out of 44 pages.

1 | P a g e Programming in c# Course code:ITA 6002 LAB:L57+58 Name:Joyoti Mondal Register no:19MCA0053 CYCLE SHEET:1 Date:16/12/19 PRACTICE PROBLEM:1 1. Write a C# program to print size of various data types. CODE:
Image of page 1
2 | P a g e using System; namespace ConsoleApp7 { class Program { static void Main( string [] args) { Console.WriteLine( "sizeof(int): {0}" , sizeof ( int )); Console.WriteLine( "sizeof(double): {0}" , sizeof ( double )); Console.WriteLine( "sizeof(float): {0}" , sizeof ( float )); Console.WriteLine( "sizeof(char): {0}" , sizeof ( char )); Console.WriteLine( "sizeof(bool): {0}" , sizeof ( bool )); } } } OUTPUT: 2. Write a C# program to swap two numbers with and without using third variable. With third variables : CODE: using System; namespace Swap1 { class Program { static void Main( string [] args)
Image of page 2