You are on page 1of 16

Source Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program2
{
public static void Main()
{
int i, j, k, r1, c1, r2, c2, sum = 0;

int[,] mat1 = new int[10,10];


int[,] mat2 = new int[10,10];
int[,] mat3 = new int[10,10];

Console.Write("\n\nMultiplication of two Matrices\n");

Console.Write("\nInput the number of rows and columns of the first matrix :\n");
Console.Write("Rows : ");
r1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Columns : ");
c1 = Convert.ToInt32(Console.ReadLine());

Console.Write("\nInput the number of rows of the second matrix :\n");


Console.Write("Rows : ");
r2 = Convert.ToInt32(Console.ReadLine());
Console.Write("Columns : ");
c2 = Convert.ToInt32(Console.ReadLine());

if (c1 != r2)
{
Console.Write("Mutiplication of Matrix is not possible.");
}
else
{
Console.Write("Input elements in the first matrix :\n");
for (i = 0; i < r1; i++)
{
for (j = 0; j < c1; j++)
{
Console.Write("element - [{0}],[{1}] : ", i, j);
mat1[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
Console.Write("Input elements in the second matrix :\n");
for (i = 0; i < r2; i++)
{
for (j = 0; j < c2; j++)
{
Console.Write("element - [{0}],[{1}] : ", i, j);
mat2[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
Console.Write("\nThe First matrix is :\n");
for (i = 0; i < r1; i++)
{
Console.Write("\n");
for (j = 0; j < c1; j++)
Console.Write("{0}\t", mat1[i, j]);
}

Console.Write("\nThe Second matrix is :\n");


for (i = 0; i < r2; i++)
{
Console.Write("\n");
for (j = 0; j < c2; j++)
Console.Write("{0}\t", mat2[i, j]);
}
for (i = 0; i < r1; i++)
for (j = 0; j < c2; j++)
mat3[i, j] = 0;
for (i = 0; i < r1; i++)
{
for (j = 0; j < c2; j++)
{
sum = 0;
for (k = 0; k < c1; k++)
sum = sum + mat1[i, k] * mat2[k, j];
mat3[i, j] = sum;
}
}
Console.Write("\nThe multiplication of two matrix is : \n");
for (i = 0; i < r1; i++)
{
Console.Write("\n");
for (j = 0; j < c2; j++)
{
Console.Write("{0}\t", mat3[i, j]);
}
}
}
Console.Write("\n\n");
Console.ReadKey();
}
}}
OUTPUT:
VISUAL PROGRAMING
(DCO-612)
Practical Number: 06

Name of the Practical: Write a programme to multiply two matrices using C#.

Submitted by:

Naqui Hasan

Roll. No. 16-DCS-047

Diploma in Computer Engineering- VI Semester

Computer Engineering Section


University Polytechnic, Faculty of Engineering and Technology
Jamia Millia Islamia (A Central University)
New Delhi-110025
Session 2018-2019
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program1
{
static void Main(string[] args)
{
int i, j, n=10;
for (i = 0; i < n; i++)
{
for (j = 1; j <= n - i; j++)
Console.Write(" ");

for (j = 1; j <= 2 * i - 1; j++)


Console.Write("*");
Console.Write("\n");
}
Console.ReadKey();
}
}
}

OUTPUT
VISUAL PROGRAMING
(DCO-612)
Practical Number: 08

Name of the Practical: Write a programme to print Pyramid using C#.

Submitted by:

Naqui Hasan

Roll. No. 16-DCS-047

Diploma in Computer Engineering- VI Semester

Computer Engineering Section


University Polytechnic, Faculty of Engineering and Technology
Jamia Millia Islamia (A Central University)
New Delhi-110025
Session 2018-2019
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
class Program4
{
static void Main(string[] args)
{
int i, j, N, count = 0; int[] freq = new int[100];

Console.WriteLine("Enter the Maximum length of the Array");


N = Convert.ToInt32(Console.ReadLine());
string[] a = new string[N];
for (i = 0; i < N; i++)
{
a[i] = Console.ReadLine();
freq[i] = -1;
}
for (i = 0; i < N; i++)
{
count = 1;
for (j = i + 1; j < N; j++)
{
if (a[i] == a[j])
{
count++;
freq[j] = 0;
}
}
if (freq[i] != 0)
{
freq[i] = count;
}
}
for (i = 0; i < N; i++)
{
if (freq[i] != 0)
{
Console.WriteLine("the number {0} frequency is={1}", a[i], freq[i]);
}
}
Console.ReadLine();
}
}
}
OUTPUT
VISUAL PROGRAMING
(DCO-612)
Practical Number: 07

Name of the Practical: Write a programme to print Pyramid using C#.

Submitted by:

Naqui Hasan

Roll. No. 16-DCS-047

Diploma in Computer Engineering- VI Semester

Computer Engineering Section


University Polytechnic, Faculty of Engineering and Technology
Jamia Millia Islamia (A Central University)
New Delhi-110025
Session 2018-2019
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
class Program4
{
static void Main(string[] args)
{
int i, j, N, count = 0; int[] freq = new int[100];

Console.WriteLine("Enter the Maximum length of the Array");


N = Convert.ToInt32(Console.ReadLine());
string[] a = new string[N];
for (i = 0; i < N; i++)
{
a[i] = Console.ReadLine();
freq[i] = -1;
}
for (i = 0; i < N; i++)
{
count = 1;
for (j = i + 1; j < N; j++)
{
if (a[i] == a[j])
{
count++;
freq[j] = 0;
}
}
if (freq[i] != 0)
{
freq[i] = count;
}
}
for (i = 0; i < N; i++)
{
if (freq[i] != 0)
{
Console.WriteLine("the number {0} frequency is={1}", a[i], freq[i]);
}
}
Console.ReadLine();
}
}
}
OUTPUT
VISUAL PROGRAMING
(DCO-612)
Practical Number: 09

Name of the Practical: Write a programme to take data input and print it using C#.

Submitted by:

Naqui Hasan

Roll. No. 16-DCS-047

Diploma in Computer Engineering- VI Semester

Computer Engineering Section


University Polytechnic, Faculty of Engineering and Technology
Jamia Millia Islamia (A Central University)
New Delhi-110025
Session 2018-2019
VIASUAL PROGRAMING
(DCO-612)

Diploma in Computer Engineering- VI Semester

Submitted by: Submitted to:


Naqui Hasan Mohd Sadiq & Mr. Arif Elahi
Roll. No. 16-DCS-047 Assistant Professor

Computer Engineering Section


University Polytechnic, Faculty of Engineering and Technology
Jamia Millia Islamia (A Central University)
New Delhi-110025

Session 2018-2019
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{

class Program3
{
public static void Main()
{
string str;

Console.Write("\n\nEnter a string from keyboard :\n");


Console.Write("Input the string : ");
str = Console.ReadLine();
Console.Write("The string entered is : {0}\n",str);
Console.ReadKey();
}
}
}

OUTPUT
INDEX
PRACTICAL NAME TEACHER
S.NO SIGN

1 Write about the Installation process of the Visual Studio

2 Write a program in Visual basic to make a simple


calculator using textbox

3 Write a program in Visual Basic to Make Calculator

4 Design a Resume in Visual Studio using Asp.net

5 Design a Registraion Form in Visual Basic using C#

6 Write a programme to multiply two matrices using C#.

7 Write a programme to print Pyramid using C#.

8 Write a programme to input a text and find the frequency


of word using C#.

9 Write a programme to take data input and print it using C#.

10 Write a programme to illustrate the voting machine using


C#.
VISUAL PROGRAMING
(DCO-612)
Practical Number: 03

Name of the Practical: Write a program in Visual basic to make a simple calculator using
textbox.

Submitted by:

Naqui Hasan

Roll. No. 16-DCS-047

Diploma in Computer Engineering- VI Semester

Computer Engineering Section


University Polytechnic, Faculty of Engineering and Technology
Jamia Millia Islamia (A Central University)
New Delhi-110025
Session 2018-2019

You might also like