Skip to content

Commit

Permalink
modified defaultarguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakshiiii23 committed Oct 6, 2020
1 parent 90092c2 commit a5d3565
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Binary file added a.out
Binary file not shown.
7 changes: 3 additions & 4 deletions call by value, call by reference, call by address
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
using namespace std;
void swap(int a,int b)
{
int temp;
temp=a;
a=b;
b=temp;
a=a+b;
b=a-b;
a=a-b;

//number after swaping
cout<<a<<b;
Expand Down
33 changes: 17 additions & 16 deletions q-12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ n value is not provided, it should print ‘*’ character 80 times.

using namespace std;

void displayChar(int n = 80, char ch = '*')
{
for (int i = 0; i < n; i++)
{
cout << ch << " ";
}
cout << endl;
}

int main()
{
int n;
char ch;
cin >> n >> ch;
void dispChar(int =80, char ='*');

displayChar(n, ch);

return 0;
int main()
{
int n;
char ch;
cin>>n>>ch;
dispChar();
dispChar(n,ch);

return 0;
}

void dispChar(int j,char c)
{

for(int i=0;i<j;i++)
cout<<c<<"\t";
}

0 comments on commit a5d3565

Please sign in to comment.