Search:

Type: Posts; User: mmk1234

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    2,961

    For me it is working, at least at visual studio...

    For me it is working, at least at visual studio 2013 it is working.
    Maybe if for some people my program is not working, you can provide me with a general idea how to substitute that?
  2. Replies
    4
    Views
    2,961

    Substitute string with file

    I wrote the following code:



    #include "stdafx.h"
    #include "string.h"
    #include "ctype.h"

    int count_nonspace(const char* str)
    {
  3. Replies
    3
    Views
    647

    Counctic characters in an array

    I have the following code which counts the numbers in an array i.e. how many times each number appears in an array (if anybody of you would have any doubts, i wrote this programme on my own and this...
  4. thus i can remove the first for loop if the...

    thus i can remove the first for loop if the caller will cal my function multiple times. If not i need two loops?
  5. My intention was to make function count to as a...

    My intention was to make function count to as a result return number of repeats of each number in an array. And i want it to checke for every possible number between [1, 127] (assumption is that i do...
  6. Problem with understanding the result of the function

    I have wrote the following function:

    int count(int size, int a[], int szuk)
    {
    int x, result = 0;
    for (szuk = 0; szuk <= 127; szuk++)
    {

    for (x = 0; x <= size - 1; x++)
    ...
  7. Thanks it works, the problem was pom variable.

    Thanks it works, the problem was pom variable.
  8. Now my code is: #include "stdafx.h" int...

    Now my code is:


    #include "stdafx.h"

    int _tmain(int argc, _TCHAR* argv[])
    {
    double a[10];
    int pom;
    int i, n;
  9. Changing the order of a numbers in an array.

    I want to write a programm that will reverse the order of the numbers in an array (e.g. as an input 1,2,3.5,4 and as an output i want 4,3.5,2,1) . But i have to problems:
    1) I do not know how to...
  10. Thanks, really appreciate your advise.

    Thanks, really appreciate your advise.
  11. You're right i have changed array type to long...

    You're right i have changed array type to long double, i dont know why i did not notice that. "llf" for long double works perfectly (I am using microsoft visual studio). Thanks
  12. no, sorry it does not work as if i will type a...

    no, sorry it does not work as if i will type a fraction like 0.5 in my series then the sum remains uchnaged code is now:


    #include "stdafx.h"
    #include "math.h"

    long double sum_array(int a[],...
  13. Sum of a fourth powers of a numbers in an array

    I want to have a programme that will calculate the sum of the fourth powers of 100 real numbers in an array (numbers in this array are stated explicitly in the code), code I have for integers is...
  14. Replies
    7
    Views
    1,513

    but how to fix it? i have changed all of the...

    but how to fix it? i have changed all of the variables to float type, what more can i do?
    edit:
    apologise i think that putting (float)solved problem
  15. Replies
    7
    Views
    1,513

    OK, this is the code. Input i want to have is a...

    OK, this is the code. Input i want to have is a natural number, output i want a value of an kth term of a sequence calculated according to the following formula:

    a_0=1 and
    a_(k+1)=a_k+(1/k!)
    ...
  16. Replies
    7
    Views
    1,513

    excuse me, i meant that it actualy compiles and...

    excuse me, i meant that it actualy compiles and after compilation no matter which number (k) i will type in i recieve an answer equal to 2
  17. Replies
    7
    Views
    1,513

    Finding kth term of a sequence

    I want to write an algorithm to find the kth term of a series given by the following recursive formula:
    a_0=1 and a_(k+1)=a_k+1/k!
    My code (part of it responsible for calculating the value of a...
  18. I am sorry, it was about k! in the denominator....

    I am sorry, it was about k! in the denominator. It is not about solving a question but about checking my code, that was created by myself, without use of any template.
  19. Simple Question about finding nth term of a sequence

    I want to find nth term of a sequence given by a formula where:
    a_0=1 a_(n+1)=a_n+1/k.
    What should be an algorithm in C language to calculate the value of kth term of this sequence? I have tried...
Results 1 to 19 of 19