www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# Assignment # 2 one third question has solved...

// Yeh Full solution nai ha 2 parts ho gay hain last nai howa abe lecture 13 menay nai lia

#include <iostream>
#include <stdlib.h>
using namespace std;
void DisplayVUID();

void DisplayReverse(char[],int);
int main(){
DisplayVUID();
char VuidReverse[12] = {'B','C','1','2','0','4','0','3','4','5','6'};
DisplayReverse(VuidReverse,11);

// Dignol wala abe lecture 13 nai lia abe loo ga aur soba solution baqi post kr do yeh bilkol theak solution ha
}
// Display Function
void DisplayVUID(){
char VUID[12] = "BC120403456";
cout "My VUID is: ";
for(int i=0; i<12; i++){
cout VUID[i];
}
}
// Reverse Function
void DisplayReverse(char* VuidReverse, int arraysize){
cout "\nMy VUID in reverse order: ";
for(int i = arraysize - 1; i>=0; i--){
cout VuidReverse[i];
}
}

Views: 524

Attachments:

### Replies to This Discussion

#include <iostream>
#include <stdlib.h>
using namespace std;
void DisplayVUID();

void DisplayReverse(char[],int);
int main(){
DisplayVUID();
char VuidReverse[12] = {'B','C','1','2','0','4','0','3','4','5','6'};
DisplayReverse(VuidReverse,11);

}
// Display Function
void DisplayVUID(){
char VUID[12] = "BC120403456";
cout "My VUID is: ";
for(int i=0; i<12; i++){
cout VUID[i];
}
}
// Reverse Function
void DisplayReverse(char* VuidReverse, int arraysize){
cout "\nMy VUID in reverse order: ";
for(int i = arraysize - 1; i>=0; i--){
cout VuidReverse[i];
}
}

#include <iostream.h>
#include <conio.h>

void DisplayVUID(){
char myID[12]={"MC123456789"};
cout "My VUID is: " myID endl;
}

void DisplayReverse(char myID[12]){
cout "My VUID in reverse order: " ;
for(int i = 11; i>=0 ; i--){
cout myID[i];
}
cout endl endl;
}

void  StoreDiagonal(){
int  matrix[9][9]={0};

matrix[0][0]=1;
matrix[1][1]=2;
matrix[2][2]=3;
matrix[3][3]=4;
matrix[4][4]=5;
matrix[5][5]=6;
matrix[6][6]=7;
matrix[7][7]=8;
matrix[8][8]=9;

for(int k=0; k<9; k++){
for (int i=0; i<9; i++){
cout " " matrix[k][i];
}
cout endl;
}

}

main(){
DisplayVUID();
DisplayReverse("MC123456789");
StoreDiagonal();
getch();

}

1

2

3

4

5

## VIP Member Badge & Others

------------------------------------

## Latest Activity

37 minutes ago
2 hours ago
Muhammad Bilal replied to BBA(6th smes)'s discussion assignment 1 spring 2021 in the group MGT402 Cost & Management Accounting
2 hours ago
★---★ ⱮԱϚҠȺហ ȺచȺហ ★---★ updated their profile
3 hours ago
Mani Siddiqui posted a discussion

4 hours ago
5 hours ago
5 hours ago
5 hours ago