You are on page 1of 3

Question No.

1:

1.
7
2.
165
106
140
3.
4 4
4 8
4 1
========================================================================
Question No. 2:
#include<iostream>
using namespace std;
void Matrix(int m[4][4])
{
for (int x = 0;i < 4;x++)
{
for (int z = 0;z < 4;z++)
{
cout << "Enter vaue of matrix[x][z]:";
cin >> matrix[x][z];
}
}
if (m[1][0] == 0 && m[2][0] == 0 && m[2][1] == 0 )
{
cout << "True"<<endl;
}
else
{
cout << "False" << endl;
}

}
int main()
{
int m[4][4];
MatrixUpper(m);
}

========================================================================
Question No. 3:

#include<iostream>
using namespace std;
int main()
{
int num = 0;
cout << "Enter number:";
cin >> num;
while (num != 1)
{
if (n % 2 == 0)
{
n = n / 2;
}
else
{
n = n * 3 + 1;
}
cout << n << endl;

}
}
#include<iostream>
using namespace std;
int Num = 8;
int x[] = { Num };
int y[] = { 0 };
void cycleLengths(int x[], int y[], int Num)
{
Num = 8;
int c = 0;
x[1] = { Num };
while (A=x[1] == 1)
{
if (x[1] % 2 == 0)
{
count=count+1;
}
x[1] / 2;
}
y[1] = { count };
cout << count << endl;
}
int main()
{
cycleLengths(x, y, Num);
}

========================================================================
Question No. 4:
#include<iostream>
using namespace std;
void Mirror(int m[3][3])
{
for (int x = 0;x< 3;x++)
{
for (int z = 0;z < 3;z++)
{
cout << "Enter value of matrix[" << x << "]" << "[" << z << "]";
cin >> matrix[x][z];
}
}
if (m[0][0] == m[1][1] && m[0][0] == m[1][1] && m[0][0] == m[2][2])
{
cout << "True.";
}
else
{
cout << "False.";
}
}
int main()
{
int m[3][3];
Mirror(m);
}

========================================================================
Question No. 5:

A.
1-64
2-1234
3-3333
4-3666

You might also like