Skip to content

Commit

Permalink
Added files
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryansood2512chitkara committed Oct 30, 2022
0 parents commit c06f766
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include<iostream>
using namespace std;

int main(){
int x;
cout<<"Enter the no. to check whether + or - : "<<endl;
cin>>x;

if(x>0)
{
cout<<"+";

}


else if(x==0)
{
cout<<"The no. is 0"<<endl;
}

else
{
cout<<"-";
}



return 0;
}
Binary file added 1.exe
Binary file not shown.
20 changes: 20 additions & 0 deletions do_while.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
using namespace std;

int main()
{

char mychar;

do
{

cout << "Iam A Programmer"<< "Enter x character to print the message again: ";
cin>>mychar;

}

while (mychar == 'x') ;

return 0;
}
Binary file added do_while.exe
Binary file not shown.
32 changes: 32 additions & 0 deletions forloops.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

// 1.Write a program to print "Iam a Programmwer " 5 times
// 2.Write a program to print multiplication table of 5


/*
#include<iostream>
using namespace std;
int main(){
for(int i = 1; i<= 5; i++ )
{
cout<<"Iam a Programmer"<<endl;
}
return 0;
}
*/


#include<iostream>
using namespace std;

int main(){
int x=5;
for(int i = 1; i<= 10; i++ )
{
cout<<"5X"<<i<<" = "<<(x*i)<<endl;
}
return 0;
}
Binary file added forloops.exe
Binary file not shown.
60 changes: 60 additions & 0 deletions switch_case.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// wap to take input from user and print the corresponding week day.

#include <iostream>
using namespace std;

int main()
{

int num;
cout << "Enter a Number between 1 and 7: ";
cin >> num;

switch (num)

{
case 1:
cout << "Monday";

break;

case 2:
cout << "Tuesday";

break;

case 3:
cout << "Wednesday";

break;

case 4:
cout << "Thursday";

break;

case 5:
cout << "Friday";

break;

case 6:
cout << "Saturday";

break;

case 7:
cout << "Sunday";

break;


//optional

default:
cout<<"Invalid Input";

}

return 0;
}
Binary file added switch_case.exe
Binary file not shown.
27 changes: 27 additions & 0 deletions table.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
using namespace std;

int main()
{

cout << "Enter the Number ,your table upto 10 will be created :- ";
int x;
cin >> x;
cout << " " << endl;
cout << " " << endl;
cout << "The Table of " << x << " is"
<< " Here 👇" << endl;
cout << " " << endl;
cout << "_____________" << endl;
cout << " " << endl;

for (int i = 1; i <= 10; i++)
{
cout << ""<< x << "X" << i << "=" << (x * i) << endl;
}
cout << " " << endl;
cout << "_____________" << endl;
cout << " " << endl;

return 0;
}
Binary file added table.exe
Binary file not shown.
18 changes: 18 additions & 0 deletions while_loop.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
using namespace std;

int main()
{
char mychar;
cout << "Enter a Character : ";
cin >> mychar;

while (mychar == 'x')
{
cout << "Iam A Programmer"
<< " | Enter a Character : ";
cin >> mychar;
}

return 0;
}
Binary file added while_loop.exe
Binary file not shown.

0 comments on commit c06f766

Please sign in to comment.