0% found this document useful (0 votes)
27 views

"Code of Tables": Using Using Using Using Using

This document contains code for two different programs. The first program uses a for loop to print out the multiplication tables for numbers from 2 to 5. The second program uses XOR bitwise operators to swap the values of two variables, a and b, without using a temporary variable. It prints the values of a and b before and after the swap to demonstrate that their values have been exchanged.

Uploaded by

Fasih Dawood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

"Code of Tables": Using Using Using Using Using

This document contains code for two different programs. The first program uses a for loop to print out the multiplication tables for numbers from 2 to 5. The second program uses XOR bitwise operators to swap the values of two variables, a and b, without using a temporary variable. It prints the values of a and b before and after the swap to demonstrate that their values have been exchanged.

Uploaded by

Fasih Dawood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 3

"CODE OF TABLES"

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication1

class Program

static void Main(string[] args)

int table = 2;

int c = 6;

for(int i = 1 ; i <=10 ; i++)

Console.WriteLine("{0} x {1} = {2}", table, i, table * i);

if (i == 10) {

table++;

i = 0;

}
if(table==c){

break;

Console.ReadLine();

CODE OF SWAPPING:
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication3

class Program

static void Main(string[] args)

int a = 9, b = 15;

Console.WriteLine("\nValues Before Swap a= {0} ,b = {1} ", a,b );

a = a ^ b;

b = a ^ b;

a = a ^ b;
Console.WriteLine("\nValues After Swap a= {0} ,b = {1} ", a, b);

Console.ReadLine();

You might also like