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?
Type: Posts; User: mmk1234
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?
I wrote the following code:
#include "stdafx.h"
#include "string.h"
#include "ctype.h"
int count_nonspace(const char* str)
{
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...
thus i can remove the first for loop if the caller will cal my function multiple times. If not i need two loops?
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...
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++)
...
Thanks it works, the problem was pom variable.
Now my code is:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
double a[10];
int pom;
int i, n;
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...
Thanks, really appreciate your advise.
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
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[],...
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...
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
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!)
...
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
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...
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.
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...