Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~1K People Reached
Favorite Forums
Favorite Tags
c x 27
Member Avatar for cusado

when i try to do the following, [code] double root_value, c; int d; d=0; printf("%.0f", root_value); for(c=2; c<root_value;c++) { if(c !=root_value) { if(fmod(root_value,c)==0) { d = 1; } } } if(d == 1) { printf("not prime\n"); } else printf("is prime\n"); [/code] now its part of a program to determine if …

Member Avatar for ArkM
0
117
Member Avatar for cusado

im trying to right align data that i have written to file with fprintf, but im not sure how i would do so in C. ive looked around and there are many solutions for C++ and C# but havent found one for to right align in regular C.

Member Avatar for Narue
0
159
Member Avatar for cusado

how to turn a user input into a text file for example user inputs 100 and the program creates a text file named 100.txt? I have tried to work it out but it still doesnt work properly. i used [code=c] getc(stdin); char filename[80]; sprintf(filename,"%d.txt", stdin); [/code] and then i also …

Member Avatar for Lazaro Claiborn
0
239
Member Avatar for cusado

im making a program that: -asks a user for their studentID and stores it as a string. -opens questions.txt for reading -prints to screen the question followed by each answer on a seperate line -accepts an answer from user in letter for i.e. a,b,c,d -writes the answer into a file …

Member Avatar for Ancient Dragon
0
125
Member Avatar for cusado

writing part of a program where user inputs an ID and the program generates a .txt file with the ID name(numerical ID). [code=c] #include <stdio.h> #include <string.h> #include <ctype.h> #define INFILE "config.txt" #define OUTFILE "studentans.ans" #define IDFILE "stdin" int main(int argc, char *argv[]) { FILE *fout; fout = fopen(IDFILE, "w"); …

Member Avatar for John A
0
92
Member Avatar for cusado

hi im still finishing a calculator program. the problem is i am wondering what command to use to break out of multiple loops. my code is [code=c] [COLOR=Gray]#include <stdio.h> #include <ctype.h> #include <math.h> double do0p(char op, float acc, float num) { switch (op) { case '+' : return acc+num; break; …

Member Avatar for WaltP
0
132
Member Avatar for cusado

im writing a calculator program in c and having some trouble.. basically it needs to have + - / * ^ functions as well as an integer only mode the code so far [code=c] #include <stdio.h> #include <ctype.h> #include <math.h> int main(int argc, char *argv[]) { float acc, num; char …

Member Avatar for Ravalon
0
178
Member Avatar for cusado

im writing a program that opens a file, reads until it arrives at a colon, then jumps over the colon and reads the number after the colon the txt file contains pi:3.14159 feetPerMile:5280 0FinDegreesC:-17.8 Count these words:3 Space before number: 2.0 What about comments: 6.024e23 so i want to skip …

Member Avatar for Lerner
0
122