Hi guys!
I've been trying to make a program that reads n elements of an array and then it displays the longest increasing subsequence of prime numbers whose reverse numbers are prime as well.
For...
Type: Posts; User: Sky_Daughter
Hi guys!
I've been trying to make a program that reads n elements of an array and then it displays the longest increasing subsequence of prime numbers whose reverse numbers are prime as well.
For...
Hi guys !
I have to make a program that rotates the digits in a number with k positions to the right. I am not sure if I understand this correctly.
I've found this problem in a book without any...
No. Actually,I see 1 1 1 and 9 1 9. What should I do? It's because of that space " "...
I've just run my program and it displays 111 and 919 instead of 113,919,911 and 913. How should I fix this problem?
Of course,it was so obvious. I forgot the a/=10. I usually don't make these kind of mistakes but this time I just couldn't figure it out. I thought that there was a/=10.
Sorry for the dumb...
Hello!
I have to make a program that reads two numbers a and b and then displays all the numbers that can be formed by replacing the first and the last digit of b with every single digit of a.
For...
I've tried to solve it but I couldn't. Please take a look at my code :
#include<iostream>
using namespace std;
int main()
{
int dg1[10],dg2[10],a,b,i = 0,j = 0,k = 0;
Hello guys!
I have to make a program that displays the k number of common digits of 2 numbers a and b.
For example if a is 23456 and b is 456900 then the number of common digits is 3(4,5 and 6)....
This is my usual notation.I am not a native english speaker so it is common for me to use ok1,ok2 and other 'terrible' variable names.
Also my program doesn't work the way it should.If n is 11 the...
Hello guys!
I have to make a program in c++ that displays on the screen all the friends numbers <= n . For example , if n is 11 then it should display the pairs :
(3,5);(5,7)
Friends numbers are...
Thank you ! It works now very well :D
My first idea was to add the last digit of every term of the sum.
By summing the digits I thought I could find out the last digit of the number given.
For example,if a is 2 the number 2^4 + 3^4 =...
Hello !
I need some help with this code(my program should display the last digit of the sum
2^a + 3^a +...+9^a - where a is a number entered from the keyboard):
#include <iostream>...
I am sorry to disappoint you but this is not the title I chose for the problem.I found this problem in a book a couple of weeks ago and this was its name 'three'.What is so wrong with it? Maybe it...
Hello guys!
I've tried to solve the next problem:
For a sequence of natural numbers n you must establish the maximum number of elements of the sequence whose sum divides 3 and the items that...
Thank you very much for your reply but I want to know why my program doesn't work and what am I supposed to do to fix the errors.
Actually,I have to find out how many ascending sequence are in the n...
Hello!
I want to make a program to arrange numbers in ascending order using arrays.
Here is what I wrote :
#include <iostream>
using namespace std;
int main()
{
Thank you again for your codes! This is what I wrote yesterday :
#include <iostream>
#include <string>
using namespace std;
bool is_name(string);
I can assure you that I'm not asking for full homework. I want to learn the C++ program language. Anyway, my program was not a homework because I haven't studied the c++ at school yet :)
@ AndrewHunter I'm sorry I asked you that stupid question about the strlen() function. When I posted yesterday I hadn't seen your reply . I don't know why but I hadn't seen it.
Anyway , I solved...
So how can I make my first program to check all the characters in the string ? Using the strlen() function ? But how?
As for the second, how do I initialise my string?
Yes, first time I wrote this program :
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{
Hi everyone! I am new to c++ programming and I want to ask you something.
I want to make a program that checks if the user entered a valid name that contains only letters.
I use the for loop and...
Thank you for replies. So should I put something else in 1000 ' s place ? A number < 1000 and the program will work,right?
About that ( if ( cin >> n ) break; ), I never used it this way. It's the...
I think I know the '\n' in the cin.ignore() but 1000?