# C++ Debug HELP

Page 1 of 1

## 1 Replies - 385 Views - Last Post: 03 November 2009 - 04:16 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=136404&amp;s=3f957f675ca2f8d6982c7a92507e3c58&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 J.holloway718

Reputation: 0
• Posts: 37
• Joined: 20-October 09

# C++ Debug HELP

Posted 03 November 2009 - 04:08 PM

Goal: Prompts the user to input a number and prints to the screen the ceiling and floor of the number.

Main:
Asks the user to begin and to continue using the program.
calls the programmer's defined function
prints the number, ceiling of the number, the floor of the number

Programmer Defined Function:
asks the user to input a number
calculates the ceiling and floor of the number
returns to the main the number, the ceiling and floor number

#include <iostream>
#include <cmath>
using namespace std;

double ceiling & floor(int a, int b );

int main(int argc, char** argv)
{

double num;
int numCeiling;
int numFloor;

cout<< To begin and continue<<endl;

cout << "Ceiling: " << numCeiling << endl;
cout << "Floor: " << numFloor << endl;

return EXIT_SUCCESS;
}

double ceiling & floor(int a, int b )
{

while((cout << "Input a number:") && !(cin >> num))
{
cout << "That's not a number." << endl;

cin.clear();

}

numCeiling = ceil(num);
numFloor = floor(num);

}

return 0;

}

ex.cpp:15: error: stray \342 in program
ex.cpp:15: error: stray \200 in program
ex.cpp:15: error: stray \234 in program
ex.cpp:15: error: stray \342 in program
ex.cpp:15: error: stray \200 in program
ex.cpp:15: error: stray \235 in program
ex.cpp:45:2: warning: no newline at end of file
ex.cpp:6: error: expected initializer before & token
ex.cpp: In function int main(int, char**):
ex.cpp:15: error: To was not declared in this scope
ex.cpp:15: error: expected `;' before begin
ex.cpp: At global scope:
ex.cpp:27: error: expected initializer before & token

Is This A Good Question/Topic? 0

## Replies To: C++ Debug HELP

### #2 Masterchief117.arbiter

Reputation: 1
• Posts: 159
• Joined: 27-March 09

## Re: C++ Debug HELP

Posted 03 November 2009 - 04:16 PM

hey spambot A) dont repost your topic you forgot the code tags "[ code ]" "[ /code ]" and C)this isnt what some of the other members would call advanced !!!!!!!!!!!!!!!!!!!!!!!!!!!