Can anyone tell me why i cant print out the max number? What am i missing? And yes, it has to be defined outside of main. thanks.
#include <stdio.h>
#define MAX(x,y) ((x)>(y)?(x):(y))
...
Type: Posts; User: brillpsycho
Can anyone tell me why i cant print out the max number? What am i missing? And yes, it has to be defined outside of main. thanks.
#include <stdio.h>
#define MAX(x,y) ((x)>(y)?(x):(y))
...
I moved the external variables into main, but am stuck now on how to get my analyze_hand function to call correctly. Any input is appreciated.
nevermind. thank you
Thanks for the encouragement! lol I know why its going to always be true- its because the lst is always going to be a right brace and fst will always be a left brace. Still messing with the push...
heres other changes that i made, but still not working:
#include<stdbool.h>
#include<stdio.h>
#define STACK_SIZE 100
Yes to the external variables. Unfortunately.
I changed to final statement to
if ( fst == '(' && lst == ')' || fst == '{' && lst == '}')
printf("\nParenthesis/brackets nested...
sample:
{(())}
- should be nested properly
{{})
- not nested properly
Hey all, Ive been working on this program for a while and keep changing it around. Im trying to have it verify that the user inputted braces are properly nested. I keep coming up with the outcome...
Hey, can anyone help me figure out why the program keeps stopping with the first letter instead of following through the string??
#include <iostream>
#include <string>
using namespace std;
But maybe I do have no business programming. I've only been doing it for 5 weeks. I've read and re-read the book I have also. And been putting in hours upon hours trying to learn. Thanks again.
OMG Thank you! Im not asking for anyone to do my work for me, i just didn't even think about closing and reopening.
currently what i have is:
input file:
this is
my file
output file:
this is
THIS IS
my file
MY FILE
i want it to output the line as read. I want it to output the entire file as read...and then the entire file as capitals.
yes!! exactly
Hit a bump again. Heres the part of my program thats not going according to plan. with my inputted file i want it to output it exactly the same, then output another copy but in all caps. As of now,...
HAHAHA just kidding. I got it.
Which compiler do you use? When i make those changes ^ it doesnt allow me to input anything.
Can anyone help me figure out what im doing wrong? I want to input a string of characters, or better yet, multiple lines of strings, and out put them as capital letters. What i have so far will allow...
heres new code:
#include <stdio.h>
int main(void)
{
int num1; //1st number
I added braces, and just for now im assuming the 1st number if the higher of the 2 numbers. With braces it changes it but im still getting an out come of my calculations only being for the 1st number...
heres what I have so far. one loop is starting at the end of the 1st instead of into it. ???
#include <stdio.h>
int main(void)
{
int n1; //number1
int n2; //number2
Hello, I am having problems doing calculations in a loop.
What Im trying to do is- count from number1 to number2- which i did using a FOR loop. So, say the numbers are 3 4 5 6 7, I need to take...
Im working on a program that will take a routing number from a check (8digits)and determine the checks number (9th digit). I got that far and was able to separate the digits
doing this:...