/* This program will take an initial guess for the root of the equation (x^3)-3=0 and will use Newton's Method to approximate an approximate root after 500 iterations, or once the margin of error is...
Type: Posts; User: SauceGod
/* This program will take an initial guess for the root of the equation (x^3)-3=0 and will use Newton's Method to approximate an approximate root after 500 iterations, or once the margin of error is...
/* The user is to enter a 9-digit social security number and check whether the number entered by the user is a valid SSN from a list of SSNs in a text file. */
#include <stdio.h>
#include...
I need help understanding why this program outputs "Count = 3" if the input file is:
-3xy' - ay" - bcos(t) = sin(t)
,
4y - 3y' = - y'
What I intended for my counter to output was the number...
Thank you. I implemented some changes, but still have the same problem.
Here is my revised code. However, my output is still multiple lines of " The above ODE is first order." The output should only be one line of "The above ODE is second order."
main()
{ int i =...
I'm having trouble identifying 1st and 2nd order ODEs. The file cp1_ODEin.txt contains the following:
-3xy' - ay'' - bcos(t) = sin(t)
However, the program identifies it as a 1st order ODE. Can...
The following code is supposed to set i to the first occurrence of a positive number in
a[0], a[1], ... , a[n]
or to n+1 if there are no positive numbers; however, the code is incorrect. I need...
Input: abcd
Output: dcba
#include<stdio.h>
#include<stdlib.h>
void mystery(void);
Write a statement that copies the 4-byte int i into j, but with the order reversed.
j = (i<<24) + (i>>24) + (((i>>8)<<24)>>8) + (((i<<8)>>24)<<8);
I am still a beginner. Can someone explain to me why the output of this program is 9?
#include<stdio.h>
#include<string.h>
void f(int * w) {*w = *w+sizeof(w);}
main(){
int a=5;
f(a);...
Actually, that still evaluates to 4. Did you mean to say that it expands to 2*3-1, which is equal to 5?
I am still a novice. Can someone explain this to me? Why is the answer 5 instead of 4?
insert
#include<stdio.h>
#define TWICE(x) 2*x
main(){
printf("%d\n", TWICE(3-1));
}
Ok. I updated the code and ran and compiled it. I still get the wrong answers. Thanks for pointing that out.
Can someone please give me a hint as to what is wrong with my code? I cannot find the correct min and max of a file of integers.
insert
#include<stdio.h>
main()
{
int count = 0, sum = 0,...
Thank you. It worked.
This is a code I made that writes "Hello" to the file out.txt. However, when I open the file, it is blank. Is it because the file should not currently exist?
insert
#include<stdio.h>
main()
{...