15,897,273 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by jasmeet singh 2021 (Top 14 by date)
jasmeet singh 2021
17-Jan-22 13:20pm
View
How to remove the highest value from the list?
jasmeet singh 2021
11-Jan-22 3:45am
View
It was same as for linked list above - To have input from user instead of predefined list. But I managed to do it
jasmeet singh 2021
10-Jan-22 18:52pm
View
Could you also help me in user input for STL list?
#include<iostream>
#include<list> // for list operations
using namespace std;
int main()
{
// initializing list of integers
list<int> list1={10,15,20,25,30,35};
// declaring list iterators
list<int>::iterator it = list1.begin();
list<int>::iterator it1 = list1.begin();
// incrementing the positions of iterators
advance(it,2);
advance(it1,5);
// printing original list
cout << "The original list is : ";
for (list<int>::iterator i=list1.begin(); i!=list1.end(); i++)
cout << *i << " ";
cout << endl;
// using erase() to erase single element
// erases 20
list1.erase(it);
// list after deletion 1 element
cout << "The list after deleting 1 element using erase() : ";
for (list<int>::iterator i=list1.begin(); i!=list1.end(); i++)
cout << *i << " ";
cout << endl;
it = list1.begin();
// incrementing the positions of iterators
advance(it,2);
// using erase() to erase multiple elements
// erases 25,30
list1.erase(it,it1);
// list after deletion of multiple elements
cout << "The list after deleting multiple elements using erase() : ";
for (list<int>::iterator i=list1.begin(); i!=list1.end(); i++)
cout << *i << " ";
cout << endl;
}
jasmeet singh 2021
10-Jan-22 15:29pm
View
many thanks
jasmeet singh 2021
10-Jan-22 15:12pm
View
Do I need to write this?
Node* head = NULL
jasmeet singh 2021
10-Jan-22 11:44am
View
Linked list has to be from user input
jasmeet singh 2021
30-Dec-21 15:20pm
View
is it possible to share the entire solution because I have so many errors after implementing above code?
jasmeet singh 2021
28-Dec-21 6:08am
View
Hi I tried above but didn't worked. Could you make changes to above program from binary to text please?
jasmeet singh 2021
24-Nov-21 18:24pm
View
Question is not to print duplicates such 2/4, 6/8.
Print only reduced fractions
The original question is posted above.
jasmeet singh 2021
21-Nov-21 11:57am
View
The program should nor print repeated values like 6/8 because its 2/3 which is already there. How to do that?
1/1
1/2
1/3
2/3
1/4
2/4
3/4
1/5
2/5
3/5
4/5
1/6
2/6
3/6
4/6
5/6
1/7
2/7
3/7
4/7
5/7
6/7
1/8
2/8
3/8
4/8
5/8
6/8
7/8
jasmeet singh 2021
19-Nov-21 7:53am
View
Deleted
Well I am genuinely stuck or may will be stuck in my current year if I don't clear this problem with Python. Don't have enough time to learn python because of overwhelming conditions. Good for you to learn Python and earn money! Please don't judge people based on their ask. Thank you!
jasmeet singh 2021
19-Nov-21 6:50am
View
I need it for submission tomorrow because it requires c++ and python both. Dont have enough time. I will start Python journey soon
jasmeet singh 2021
19-Nov-21 6:27am
View
well I wrote this program in c++ myself and want this in python. But dont know python so the help would be great. Its a short program
jasmeet singh 2021
18-Nov-21 6:15am
View
Thanks that helps.
Could you help me to write the same code in Python?
#include <iostream>
using namespace std;
int main() {
int n;
cout<<"Enter n"<<endl;
cin="">> n;
cout << "1/1" << endl;
for (int denominator = 1; denominator <= n; denominator++) {
for (int numerator = 1; numerator < denominator; numerator++) {
if (denominator % numerator < n) {
cout << numerator << "/" << denominator << endl;
}
}
}
return 0;
}
Show More