Thank you i understand it now.
What i did as a test is printing s[i] (before i made this thread), and i was confused cause i didn't converted it to int, and still i would get numbers printed, which...
Type: Posts; User: Stevan
Thank you i understand it now.
What i did as a test is printing s[i] (before i made this thread), and i was confused cause i didn't converted it to int, and still i would get numbers printed, which...
I was solving Project Eular-Problem 56 ( Problem 56 - Project Euler ), its relatively easy problem.But i encountered a small issue.I was so frustrated cause i couldn't find solution, so i have to...
Hello,
When you solve problems that root wrote, i would strongly recommend to use function in this program (you also get that hint in the assignment ). I would give you a idea how do it
...
Hello,
First thing, you didn't even initialized one and two, cause
int one,two,three=0 isn't equal to one=0,two=0,three=0,you just initialized three.
While loop seems ok, i would only put some...
How did i miss that? Thank you, it works like a charm :)
Thank you i did it , and also i didnt need two insructions only one
s+=mpz_tdiv_q_ui (result,result, 10);.
And instead while i did for loop that goes from 1 to 300 (i suppose that number is not...
Hello guys, i am trying to solve Project eular problem-20 :"Find the sum of the digits in the number 100!".So i downloaded and included gmp libary for big integer.This is my code:
#include...
You could also change opt_no to char, cause '1' is type char.
No need to use a pointer here, just declare a as array, with some max size that you want.
scanf("%d", &opt_no);
Instead of scanf use getchar.
opt_no=getchar();
And switch statement will work.
@abhishekcoder, which term, 1/0! ?
float sum=1.0,fact=1.0;
Your sum should be equal to 0 not 1, cause you are not multiplying sum, you are adding.
I solved it finally here is the code:
for(i=0;i<n;i++)
{
b=1;
for(c=0;c<n;c++)
{
if(i%prb[c]==0)
{
Thank you guys!
Quzah, what do you mean by "You also never actually initialize prb"?
I have to say i just started working with arrays, so i realized it like this, there will be max slots, and in...
Ok, but still i dont know how to do this:
if(i%prb[0] && i%prb[1] && i%prb[2]..... i%prb[q])
Easy way, with loop.
Hello guys,i have, a problem with my array and i hope you guys can help me solve it. So i have assignment to print out number which are multiplied by prime number 2,3 and 7, and no other prime...