C :: Doing Program With If Statement That Recognizes Letters

Oct 15, 2013

Im still new to this but i dont quite understand whats wrong with this code

Code:
#include <stdio.h>
int num1, num2, num3;
char resp;
int main()
{
printf("Quer os seus numeros em ordem crescente ou decrescente?

[Code] ....

It is in portuguese but the thing is, when i type the C when it asks for the response it still reads as if it was D the response

View 5 Replies


ADVERTISEMENT

C++ :: A Program To Print Big Letters?

Nov 28, 2013

I need help writing a program where I use small letter to write names in Big letters. (I dont know if you understand what i mean). Follow link to description.

[URL]

View 6 Replies View Related

C :: Program To Print Letters In Given Notation

Feb 11, 2014

I have to develop script in C to print the alphabets in given notation.

Please check the attachment.

View 4 Replies View Related

C++ :: Password Program That Receives 10 Letters Only

Jan 21, 2015

So I need to make a program that recieves a 10 letter only password, then once the password is entered, it starts off as AAAAAAAAAA...AAAAAAAAAB...AAAAAAAAAC...etc, Until it gets the correct password, which it then stops. This is for a science fair project on cyber security not for malicious purposes ...

View 2 Replies View Related

C++ :: Program To Stop If Letters Entered Other Than A / B Or C

Apr 15, 2014

I am new to c++ programming, and I wrote this program. It runs perfectly but the problem is I want the program to stop If I entered letters other than A,B or C

The code as follows:

#include <cstdlib>
#include <iostream>
#include <cstring>
#include <iomanip>
using namespace std ;
int main() {
// Deceleration Statements

[Code] ....

View 6 Replies View Related

C :: Program That Counts Letters Of 3 Lines Of Input From User

May 26, 2013

So I am writing a program that counts the letters of 3 lines of input from the user. I am using a 3 x 80 character array as the "notepad". Upper and lower case characters are incremented on the same counter array.

Code:

/*Letters in a string*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void countAlphabet(char *);
/*Character counting array*/
int alphabet[26] = {0};

[Code]...

View 3 Replies View Related

C++ :: Program Enters If Statement Even Though Requirements Not Met

Jul 25, 2014

My program gets user input and compares it against an array of characters (guessLetters[x]) to decide whether the do/while loop repeats. The whole character array contains underscores yet if i enter any letter it goes into the if statement and repeats the do/while loop.

do {
repeatflag = false;
cin >> UserInput;
UserInput = toupper(UserInput);

[Code] .....

View 2 Replies View Related

C/C++ :: How To Use Switch Statement 2 Times In A Program

May 10, 2012

How can we use switch statement 2 times in a program?

View 2 Replies View Related

C/C++ :: How To Put All Questions In One Program By Using Switch Statement

Mar 22, 2013

How to put my all assignment questions that are 6 in number in one program by using switch statement ?

so if a user wants to see any question by choice!

View 1 Replies View Related

C :: Program That Have Starting Menu For A Calculator Using If / Else Statement

Sep 21, 2014

I just started learning C and trying to create a program in C that will have a starting menu for a calculator. The problem is that I could do that with a switch/case but the assignment requires me to use if/else.

Here's what I have so far:

Code:

#include <stdio.h>
int calc();
int menu();
int main() {
printf("Hello. Welcome to the program.
");
printf("Press RETURN key to continue...

[Code]...

How should I go from now using if/else to have those 4 choices?

View 5 Replies View Related

C++ :: Write A Program That Has A Menu With A Switch Statement?

May 4, 2014

I'm trying to write a program that has a menu with a switch statement. I'm getting "case label'1' not within a switch statement" and subsequent errors for the other two choices and the default.

int main(){
int choice;
Matrix A,B,C;
cout <<"What would you like to do? "<< endl;

[Code]....

View 2 Replies View Related

C++ :: Cout Statement Not Working - Program Outputting Zero For Variable

May 20, 2013

Why is my program outputting zero for the variable pop?

Code:
#include <iostream>
int main(void){
using namespace std;

//capture data
cout << "Enter the world's population: ";

[Code] ....

It's obviously not std::cout, but I'm thinking its the way I'm operating on long?

View 5 Replies View Related

C++ :: Program To Compute And Print A Billing Statement For Each Patient

Oct 17, 2013

Community Hospital needs a program to compute and print a billing statement for each patient. Charges for each day are as follows:

a. room charges: private (P) room = $125.00; semi-private (S) room = $95.00; or ward (W) = $75.00
b. telephone charge = $1.75
c. television charge = $3.50

Write a program to get data from the keyboard, compute the patient’s bill, and print an appropriate statement. Typical input (nut yours do not have to be identical to this) is the following:

How many days was the room occupied? 5
What type of room? P
Telephone used during the stay? N
Television used during the stay? Y

Keep in mind that the user needs to know that the input can be any integer number of days for the length of stay, either (P, S, or W) for the room type, and either (Y or N) for both telephone and television options.

A statement (which yours MUST be identical to) for the data given follows:

Community Hospital Patient Billing Statement

Number of days in hospital: 5
Type of room: Private
Room charge:$ 625.00
Telephone charge:$ 0.00
Television charge:$ 17.50

TOTAL DUE = $642.50

View 3 Replies View Related

C++ :: Program That Allows User To Enter Statement And Outputs Statistics?

Dec 12, 2013

a program that allows the user to enter a statement and outputs statistics; number of vowels, number of constants, percentage of vowels and constants, number of words, number of punctuation characters

View 2 Replies View Related

C :: Finding Percentages / If Statement / Clear Screen And Reloading Program

Nov 11, 2013

For my C programming module, I've been asked to create a program which is basically a ten question mathematics quiz or test if you like. Below is a copy and paste of my current, working program.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main () {

[Code]....

I am also trying to include into my program; If the user achieves 4 or less marks in the test, they are asked if they would like to repeat the test (have a second chance).

I have been asked by my Lecturer to ask the Question; "Would you like to try again" and the response is 'Y' for yes, 'N' for no. Would this be shown by:

char Y = Y;
char N = N;
printf("Would you like another go?");
scanf(%d%, &Y, &N);

And finally; If the user would like another go, then I am trying to include the code that clears the screen and then reloads the program?

What code is used to clear the screen and no clue what code is written to refresh or reload the program. I assume it's a loop statement or some sort.

View 1 Replies View Related

C++ :: Tell A Program To Continue Executing Next Line Of Code Within Nested IF Statement?

Nov 25, 2013

Is there a way to tell the program to continue reading the next line of code within a nested IF statement?

The reason I want to do this is because the two "else" statements in the following sample (the main and the nested else) will contain the same exact code and I don't want to repeat it twice. I know I can do this by creating a function and calling it from each else statement but I was just wondering if what I'm asking is even possible without using a function.

if(1 < 2) {
// yes 1 is less than 2
if(5 > 10) {
// do something
} else {
// no, 5 in not greater than 10
// here is where I want to tell the program to continue reading the next else statement

[Code] ....

View 8 Replies View Related

C++ :: Program To Order Pizza - Empty Controlled Statement Found Error

Aug 25, 2013

I am creating a pizza program for ordering a pizza and I have removed all the errors except for two. I have tried everything I can think of to fix this problem so it will compile, but to no avail. The only errors left are:

1>------ Rebuild All started: Project: Pizza Order App Midterm, Configuration: Debug Win32 ------
1> stdafx.cpp
1> Pizza Order Midterm.cpp
1> Pizza Order App Midterm.cpp
1>c:usersindia-n-jerrydocumentsvisual studio 2010projectspizza order app midtermpizza order app midtermpizza order app midterm.cpp(57): warning C4390: ';' : empty controlled statement found; is this the intent?

[Code] ....

The entire code is listed below seperated into 1 header and 2 cpp files.

// OrderPizzaApp.cpp : Defines the entry point for the console application.//

#include "stdafx.h"
#include "Pizza_Order.h"
#include <iostream>
#include <string>
using namespace std;

// prototypes
Pizza_Order createPizza_Order();

[Code] .....

View 5 Replies View Related

C++ :: Transfer If-else Statement Into Switch Statement?

Sep 7, 2013

How to make if else code below into SWITCH STATEMENT?

cout << "Enter the temperature: ";
cin >> temp;
cout << "Enter the pressure: ";
cin >> pressure;
cout <<endl;

[Code]....

View 6 Replies View Related

C++ :: How To Count Letters

Mar 16, 2013

I'm just trying to find out if the way I've setup my code currently allows me to count the letters as they occur? I don't yet see how to do it but I need clarification. Ideally the function letterCounter would do the counting but atm I'm just trying to figuring it out in the display function.

View 2 Replies View Related

C :: Writing Numbers In Letters?

Jan 26, 2013

Code:
#include<stdio.h>
#include<string.h>
#define a 9
#define b 9
#define c 3
int main() {

[Code] .....

In practice section there was a challenge to print up numbers in letters up to billion including negatives I didn't look at the solution and came up with this but it is getting difficult after this point....

View 9 Replies View Related

C :: Printing A Parallelogram From Letters

Nov 14, 2013

These are the instructions: read a number between 1-26 and build a parallelogram in the size (height&width) of the number entered.

Each row of the parallelogram will be built from each capital letter from 1 to the number read (max 26).for example: by entering the number 3, will be printed:

AAA
_BBB
__CCC

for the number 4:
AAAA
_BBBB
__CCCC
___DDDD

I am struggling with how to change each char in every different row, how do I print this parallelogram ?

View 8 Replies View Related

C :: Converting Letters To Hexadecimal

Jun 3, 2014

i m trying to write a code that would convert a each letter from a text to their decimal images . while i was able to write the part of entering the text , i cant do the converting part , i searched all day on the internet and found nothing.

View 3 Replies View Related

C++ :: How To Read Selected Letters

Jun 1, 2013

I have a text file in which i need to read only selected letters and substitute them with integers to calculate.

Eg:-
In the text file
f2,h1

Here i need to read only the the letters f & h and substitute them with some integer and add them up.

View 1 Replies View Related

C++ :: Swapping Letters In Array

May 3, 2013

I have a function that is suppose to swap positions of 2 letters but It doesn't seem to work. Im passing in the array of char into the function.

void swapletter(char word[]) {
char temp1;
int swap1;
int swap2;
cout<<"What is the first location: ";
cin>>swap1;

[Code] ....

View 6 Replies View Related

C++ :: How To Put 2 Letters Together And Make Them To Count As 1

Mar 11, 2013

how to put 2 letters together and make them to count as 1?

provided that they must consecutive

for example:

p : count as 0
pxp : count as 0
pp : count as 1
xpxp: count as 0
ppxpp : count as 2

View 1 Replies View Related

C++ :: Capital And Lowercase Letters?

Sep 26, 2013

I am writing a code that requires the user to input either B or b for bright or D or d for dim. Basically, B is bright and D is dim but I have to code the program such that it allows for both he capital letter and the lowercase letter to be recognized.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved