Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p3_i.cpp #43

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions e1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<iostream>
using namespace std;
main()
{
int a;
cout<<"enter a number"<<endl;
cin>>a;
if(a%2==0)
{
cout<<"Even"
}
else
cout<<"Odd";
}
File renamed without changes.
16 changes: 16 additions & 0 deletions e2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@




#include<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter the number:"<<endl;
cin>>num;
if(num>0) cout<<"Number is Positive"<<endl;
else if(num==0) cout<<"Number is '0'"<<endl;
else cout<<"Number is Negative";

}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions h1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include<iostream>
using namespace std;
int main()
{
int n=8,num=5,pattern[9][9];
//for first diogonal triangle
for(int i=0;i<=n/2;i++,num--)
for(int j=i;j<=n-i;j++)
{
pattern[i][j]=pattern[j][i]=num;
}
num=5;
//for second diogonal triangle
for( int i=n;i>=n/2;i--,num--)
for(int j=i;j>=n-i;j--)
{
pattern[i][j]=pattern[j][i]=num;
}
for(int i=0;i<=n;i++)
{
for(int j=0;j<=n;j++)
cout<<pattern[i][j]<<" ";
cout<<endl;
}

}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added m7.cpp
Empty file.
Empty file added m8.cpp
Empty file.
Empty file added m9.cpp
Empty file.
Empty file added p1.cpp
Empty file.
Empty file added p2.cpp
Empty file.
14 changes: 14 additions & 0 deletions p3_i.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter no. of rows:";
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=0;j<=i;j++)
cout<<"*";
cout<<endl;
}
}
Empty file added p3_ii.cpp
Empty file.
Empty file added p3_iii.cpp
Empty file.
Empty file added p3_iv.cpp
Empty file.
Empty file added p3_v.cpp
Empty file.
Empty file added p4.cpp
Empty file.
Empty file added p5.cpp
Empty file.
Empty file added p6.cpp
Empty file.
Empty file added p7.cpp
Empty file.
46 changes: 46 additions & 0 deletions questions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ MEDIUM

10. Program to check if entered number is an Armstrong Number.

11. Program to convert Decimal Number to Binary

12. Program to convert a Binary Number to Decimal Number

13. Program to convert Decimal Number to Octal Number

14. Program to convert a Octal Number to Decimal Number

15. Program to convert a Hexadecimal Number to Decimal Number

16. Program to convert Decimal Number to Hexadecimal Number

17. Program to evaluate a POSTFIX expression using Stack

18. Program to convert an INFIX expression to POSTFIX using Stack

19. Program to implement QUEUE using Linked List

20. Program to implement PRIORITY QUEUE using Linked List

21. Program to implement NON-CIRCULAR QUEUE using Arrays

22. Program to implement DEQUE using Linked List

PRACTITIONER

1. Program to reverse a number.
Expand Down Expand Up @@ -97,3 +121,25 @@ v) 55555
- Push an element in Stack
- Pop an element from Stack
- Display the elements in Stack

HARD

1. Program to Print the following Pattern
555555555
544444445
543333345
543222345
543212345
543222345
543333345
544444445
555555555

2. Program to implement the concept of Sparse Matrix

3. Program to demonstrate the use of storage classes like static, register, etc

4. Program to demonstrate the use to static variables and functions.

5. Program to demonstrate the concept of inheritance