Programming Question

Discuss Computer Science and Programming related problems

Moderators:Labib, bristy1588

Shifat
Posts:53
Joined:Sun Jul 31, 2011 12:21 pm
Location:Dhaka, Bangladesh
Programming Question

Unread post by Shifat » Mon Aug 22, 2011 8:41 pm

I have a question to ask.... According to the conjecture of Goldbach we can write an even number (>2)..as the sum of two primes, example-8=5+3,90=83+7 etc...... Now I want to write a program using Qbasic (i am novice since).. where I will input an even number greater than 2, and the output will be two primes... I am having a bit problem to make the algorithm,and the sudocode so please help.
Last edited by Shifat on Mon Aug 22, 2011 8:50 pm, edited 2 times in total.

Shifat
Posts:53
Joined:Sun Jul 31, 2011 12:21 pm
Location:Dhaka, Bangladesh

Re: Programming Question

Unread post by Shifat » Mon Aug 22, 2011 8:49 pm

Well I submit a way here, please check if it is programmable,
1.Input A
2.P=3
3. Compare- If (A-P) is a prime then N=A-P
print N,P. Goto 6
else go to next step
4. find the next prime form P to A
let the prime is Q
5. P=Q and goto 3
6.end

User avatar
amlansaha
Posts:100
Joined:Tue Feb 08, 2011 1:11 pm
Location:Khulna, Bangladesh
Contact:

Re: Programming Question

Unread post by amlansaha » Sat Dec 03, 2011 12:00 pm

i think your alogarithm is correct :)
অম্লান সাহা

shayanjameel08
Posts:10
Joined:Mon Nov 04, 2013 6:17 pm

Re: Programming Question

Unread post by shayanjameel08 » Wed Nov 13, 2013 11:22 am

My question is ..Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.

User avatar
Phlembac Adib Hasan
Posts:1016
Joined:Tue Nov 22, 2011 7:49 pm
Location:127.0.0.1
Contact:

Re: Programming Question

Unread post by Phlembac Adib Hasan » Wed Nov 13, 2013 11:49 am

shayanjameel08 wrote:My question is ..Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.
One approach can be searching each element of the first array individually in the second array.
Welcome to BdMO Online Forum. Check out Forum Guides & Rules

Mehedi Mhc
Posts:1
Joined:Fri Oct 21, 2016 8:33 am

Re: Programming Question

Unread post by Mehedi Mhc » Fri Oct 21, 2016 9:53 am

I want to make a desktop app in C or C++. How can I do so? I shall wait for the answer.
Last edited by Phlembac Adib Hasan on Mon Nov 07, 2016 12:17 pm, edited 1 time in total.
Reason: Spelling and syntactical error correction

User avatar
Phlembac Adib Hasan
Posts:1016
Joined:Tue Nov 22, 2011 7:49 pm
Location:127.0.0.1
Contact:

Re: Programming Question

Unread post by Phlembac Adib Hasan » Mon Nov 07, 2016 12:32 pm

To write a desktop app, you need to use a framework. I would recommend Qt, a very popular framework. Visit its website: https://www.qt.io/
Welcome to BdMO Online Forum. Check out Forum Guides & Rules

Post Reply