It compiles. It runs. But when I enter the three values and then press Enter, it doesn't do anything.
EDIT:
I have a similar program for adding two integers that works, but I don't see why the...
Type: Posts; User: nerio
It compiles. It runs. But when I enter the three values and then press Enter, it doesn't do anything.
EDIT:
I have a similar program for adding two integers that works, but I don't see why the...
Hello.
I am trying to write a program that adds three integers. It does not run. Where is the mistake?
#include <stdio.h>
#include <stdlib.h>
int addthreeintegers(int i,int j,int k);
Hello.
I am trying to copy the content of one string into an another. But it does not work. Why not? Here is the code:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include...
Are you guys from the same school having the same teacher telling you to do this particular assignment?
http://cboard.cprogramming.com/c-programming/148955-atm-file-processing.html...
I would read the file line by line, parse the strings and convert the desired ones from a string to a double and then compute the ar. mean.
Alternatively you can simply copypaste it and compute it...
It does not mean "pyramid number".
Pyramid number is defined as a sum P_n=1^2+2^2+3^2+...+n^2, while this guy has for entry 421 output 14, 15 (14^2+15^2, which is a difference P_15-P_13, and no...
In English language it is called orthogonal.
https://en.wikipedia.org/wiki/Orthogonality
#include <stdio.h>
#include <stdint.h>
Q0: What is the real purpose of malloc(), realloc() and free() functions?
I have read that they enable to allocate memory in cases when the amount of memory to be allocated is unknown. But in that...
Here is how to do if statements in C:
if...else statement in C
In the code that I posted in post #5 there is a mistake in comparing chars. I find it pretty difficult to compare char variables.
if(buffer[i]=="a" || buffer[i]=="e" || buffer[i]=="i" ||...
@ Matticus : Maybe he understands what I do not and I understand what he does not. And from an incorrect code one can learn to identify mistakes. Maybe instead of writing it all from zero he can...
Here is my code, it does not work, but maybe it will help you.
I tried to debug it, the problem part will be the loop at the end.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>...
Thank you for replies. The entering of negative value I have already mentioned in post #3. Thank you for helping me to get to these thoughts.
Original problem is solved now.
I am also...
@laselight : reading one by one requires to know when do you stop. That requires to know number of items, which is not given. And asking when to stop after every entry is the 1) solution.
Or a...
Hello.
I am working on a program that will compute arithmetic mean of certain number of real numbers (in C double) without knowing the number of items.
I can think of two solutions.
1) I can...
Thank you all.
Here is the current version:
#include <stdio.h>
int main()
{
int i,j;
Post number three of this thread contains a corrected version.
So the formatting is about number of spaces between a code starts on a line and between spaces between lines of different type of...
I think that the one I used is the Allman style.
https://en.wikipedia.org/wiki/Indent_style#Allman_style
I see it now. For the code more on the right I used the Whitesmiths_style..
...
Hello.
I want to learn how to indent and format properly my source codes. I have found this online:
https://en.wikipedia.org/wiki/Indent_style
GNU Coding Standards: Formatting
Here is a...
Have a look here.
Also, if you call the function in the main, just use foo() instead of foo(void).
I am working on a program that prints "How are you?" on the screen by printing byte by byte.
First I wrote
#include <stdio.h>
#include <stdlib.h>
int main()
{
putchar(72);
Do you have a specific example in mind?
Like you are given points and possibly also degree and you want to know the coefficients?
You could use linear regression, or in general polynomial...
Your question is too much wide to answer.
In general a polynomial can have any coefficients (if you meet the condition a_n is not 0).
It would help to know what is given. Do you know points on...
I intend to write a program that XORs two given files, until the length of the shorter one. As an exercise I was advised here to write a different program first that will copy a given file.
...
Is better an array or a structure for that?
I have currently two versions (both are inspired by from c - Copying Binary Files - Stack Overflow)
Could you please help me with it? I do not have a...