#include <stdio.h>
int euclid(int a,int b, int c)
{
if(b==0){
c++;
return a;
}
else {
Type: Posts; User: dsured
#include <stdio.h>
int euclid(int a,int b, int c)
{
if(b==0){
c++;
return a;
}
else {
What is the difference between these programs? I am studying for an exam and I think the 2nd one is easier to follow, its recursive I know that...
void ResetList(struct point **ptrFirst,...
Thanks!
When I run the code, nothing comes up, I mean--when I input data and press enter, it moves to a new line... I have a feeling the code isn't processing anything.
luna:~>a.out
1234...
Thank you for the tips so far.
I added the string.h at the start,
I pressed enter on the source file, employee.dat, and I still got the same errors
"lab7.c", line 84: warning: newline not...
I created a blank employee.dat file and this is what the compiler gave me
"lab7.c", line 4: warning: invalid white space character in directive
"lab7.c", line 38: warning: implicit function...
When I run my program I get this...
where am I going wrong?
"lab7.c", line 4: warning: invalid white space character in directive
"lab7.c", line 38: warning: implicit function declaration:...
This is what I have
*fgets(char *e, sizeof(e), file);
I tried what you said and I had issues. I added the fgets before the loop and got the error "incompatible type for argument 1 of fgets"
if(file ==NULL){
printf("Cannot create...
The object of my assignment is to read data from a file, capitalize the first letter of all the names within the file and rewrite the file. Simple enough right?
Just one small problem. The file we...
is it really needed when doing a scanf?
void flush_in (){
int ch;
while ((ch = fgetc (stdin))!= EOF && ch != '\n'){}
}
an example of when its called is
scanf("%s",contact[i].postalcode);
flush_in();
Can someone please walk me through the trace of this code? I have been trying for awhile and get the output wrong!
#include <stdio.h>
int f(float);
float g(int);
int h(int*);
Hi! I am trying to figure out a way to store all tokens of a sentence into an array except the token 'done' which is the last word of the sentence, but not part of the sentence itself (it is purely...
I have tried and gotten most of it, I put a comment by the else "//must be a digit. Build a number." Where I need the help. Some notes:
There is a 100 word upper limit on the number of different...
The program compiles, however the output is incorrect
Output:
Input size of array5
Input elements3
5
4
7
I did include math.h in the header.
I should have included this,
s=values[j]+values[l];
number1=r-t;
number2=r-s;
if (number1<0)
number1*=-1;
if (number2<0)
number2*=-1;
I am just curious if there is any other way I could write this code, I see 3 if statements in a row and am wondering if there is a more efficient way.
if (number1<0)
number1*=-1;
if...
Delete
I need help to make a program that generates random numbers and sorts them using bubble sort
I cannot pass any parameters in function calls.
It was a required instruction for this program, I am a little stuck, I got it running for one Washer, but adding another one, I have been working on...
#include <stdio.h>
#include <math.h>
double quantity1, thickness1, density1, inner1, outer1;
double product, area;
double washerA;
/* Prototypes */
void ReadData...
No I have not, can you give me an example using my program to get me in the right direction please?
How would I do that, I am new at programming! Just getting used to the forum.
Closed, please remove.
Thanks.