User Profile
Collapse
-
oh duh thanks for the help. -
trouble with compiling my program
Hi here is my problem when I compile my program it gives me the error " error C2296: '%' : illegal, left operand has type 'double". any help in explaining this is much appreciated.
Code:quot = n1 / n2; mod = n1 % n2;
-
Hey it worked thanks for the quick reply to my problem and the explanation of what I was doing wrong it is much appreciated.Leave a comment:
-
basic C++ conversion program help
Hi here is the problem when my program tries to convert Fahrenheit to Celsius it gives an answer of zero regardless of what degree you put in. Any help in solving this is much appreciated.
Code:#include <iostream> using namespace std; int main (void) { double inch_feet, inch_yard, inch_cent, inch_meter, fahrenheit; double inch_cv_feet; double inch_cv_yard;
-
seven strings sort
Hi if your here to help thanks in advance. My problem is I'm writing a code to take seven strings put in by the user sort them alphabetically than print them, but I my compiler is telling me strcmp command is wrong so I cant compile it and I am sure their are other things wrong please help.
[CODE}
#include <stdio.h>
#include <string.h>
# define N_STRINGS 7
void swap(char... -
-
function that catches errors
Hi here is my problem im adding to a program to catch errors.The program below catches errors like integers less than 0 or not equal to 1 but if I put in a number like 223e it doesn't catch the e as an error I know I am missing something in my error = sscanf() line but cant figure it out please help.
Code:char line[MAXLINE]; int error, n; do{ printf("Input a positive integer: "); fgets(line,
-
-
Greatest common divisor
Hi I'm trying to write a program to find the greatest common divisor of 2 numbers input by the user. This is what I got so far:
Code:#include <stdio.h> int gcd(int a, int b); int main(void) { int a, b,r; printf("Please input two positive integers"); scanf("%d%d", &a, &b); gcd(a, b); if (gcd(b, r))
-
Hey sorry for the extremely late post but i solved the problem now I just have to put the printed data into columns.
Code:#include <stdio.h> void swap(int *, int *); #define SIZE 8 int main(void) { int a[] = {7, 3, 66, 3, -5, 22, -77, 2}; int i, j; for (i = 0; i < SIZE; ++i) { for (j = i +
Leave a comment:
-
I figured that was the problem but was hoping it was something more easier like something wrong with my code as I can't/haven't figured out how to print the list on each pass of the loop. I been at it for the past 3 days and still can't figure it out. My book is crap so I've been searching websites for more info. any help to help me solve this is greatly appreciated thanks.Leave a comment:
-
Help with transposition sort
Hi here is my problem and thanks in advance for responding. I'm doing a transposition sort and when I compile the program it -77 -5 -77 2 -77 3-77 but when it prints it should look like this:
unordered data: 7 3 66 3 -5 22 -77 2
after pass: 1 -77 3 66 3 3 22 -5 2
after pass: 2 -77 -5 66 7 3 22 3 2 etc.
Can you help by pointing me in the right direction to what I am doing wrong?
... -
Whoops I just figured it out but thanks to everyone that responded and tried to helpLeave a comment:
-
I've got the program to at least build and executed it by adding the underlined code.
Code:void report(outcome result, int *win_cnt_ptr, int *lose_cnt_ptr, int *tie_cnt_ptr, [U]p_r_s player_choice, p_r_s machine_choice[/U])
Leave a comment:
-
yeah thats basically it. In select.cpp the player and the machine makes a choice of rock paper or scissor. In report.cpp I want to call the selection that the player and the machine made in select.cpp to report.cpp and print that selection.Leave a comment:
-
rock, paper, scissor help C programming
Hi here is my problem I want to have the outcome of my rock paper scissors game to print outcomes like: You chose paper and I chose rock. You win. The value for player_choice and machine_choice is declared in select.cpp (listed below).
My question is how would I go about telling, the report.cpp code below to check the select.cpp code for the variable to print?
#include "p_r_s.h"
void report(outcome... -
Hey thanks for the help! I got the program working by changing the != signs to == and editing the main program. I really appreciated the help and am going to re-read the chapter on relational, equality, and logical operators. Thanks againLeave a comment:
-
yes I have tried running the code. say if I put in asdfjkl it re-puts out asdfjkl and doesnt delete any vowels. I'm thinking their is something wrong with my isvowel function or something wrong with the main program and the way its using the returned 1 or 0 from my isvowel function.Leave a comment:
-
isvowel assignment C# programming
Hi,
I am having serious trouble writing the code for an assignment I am working on. I am a C# beginner and any help would be much appreciated thank you.
The question is:
The ancient Egyptians wrote in hieroglyphics, in which vowel sounds are not represented, only consonants. Is written English generally understandable without vowels? To experiment, write a function isvowel ( ) that tests whether or not...
No activity results to display
Show More
Leave a comment: