Lab 6 Functions
Lab 6 Functions
Lab 6: functions
Lab Tasks
1. Write a function that displays at the left margin of the screen a solid square of asterisks whose
side is specified in integer parameter side. For example, if side is 4, the function displays:
}
int main(){
int x, y;
cout << "enter the number of sides of starik" << endl;
cin >> x;
y = x;
s_square(x, y);
return 0;
}
output:
2. Modify the function created in task 1 to form the square out of whatever character is contained
in character parameter fillCharacter. Thus if side is 5 and fillCharacter is “#” then
this function should print:
}
int main(){
int x, y;
char l;
cout << "enter the number of sides of starik" << endl;
cin >> x;
cout << "enter the special character you want to display" << endl;
cin >> l;
cout << endl;
s_square(x,l);
return 0;
}
output:
Code:
//muhammad abubakar rashid
//459565
#include<iostream>
#include<cmath>
int main(){
float x, y;
double m;
Code:
//muhammad abubakar rashid
//459565
#include<iostream>
#include<cmath>
int main(){
int x, y, z;
Deliverable:
Please submit a word document with codes of all tasks and output on LMS
before the deadline.