Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Problem with a program

bridgesbridges Member Posts: 8
Can you tell me why I can't get this program to run? And, how or where do I find the "or" symble and the symble at the end of "end", the one that looks like a "7."


/*
#include

int main (void)

{

int m, n, r;

cout <<"
PROGRAM Gcd C++";
cout << Enter two integers: ";
cin >> m >> n;
cout << "
GCD (" << m<< ", " << n <<") = ";
while (n ! = 0) {
r = m % n;
m = n;
n = r;
}
cout << m << end;
}

*/

Comments

  • chamsterchamster Member Posts: 662
    : Can you tell me why I can't get this program to run? And, how or where do I find the "or" symble and the symble at the end of "end", the one that looks like a "7."

    1) What happens when you run it exactly? I don't see any problem with it.
    2) What do you mean by "or" and "7" symbols?

    [code][size=1]
    : /*
    : #include
    :
    : int main (void)
    :
    : {
    :
    : int m, n, r;
    :
    : cout <<"
    PROGRAM Gcd C++";
    : cout << Enter two integers: ";
    : cin >> m >> n;
    : cout << "
    GCD (" << m<< ", " << n <<") = ";
    : while (n ! = 0) {
    : r = m % n;
    : m = n;
    : n = r;
    : }
    : cout << m << end;
    : }
    :
    : */
    [/code][/size]


    Kind Regards
    Konrad
    ----------------------------
    (+46/0) 708-70 73 92
    chamster@home.se
    http://konrads.webbsida.com

  • chamsterchamster Member Posts: 662
    Also - are you trying to code C++ or C#? I'm asking because this is posted in a C#-group...



    Kind Regards
    Konrad
    ----------------------------
    (+46/0) 708-70 73 92
    chamster@home.se
    http://konrads.webbsida.com

  • kogikogi Member Posts: 3
    : Can you tell me why I can't get this program to run? And, how or where do I find the "or" symble and the symble at the end of "end", the one that looks like a "7."
    :
    :
    : /*
    : #include
    :
    : int main (void)
    :
    : {
    :
    : int m, n, r;
    :
    : cout <<"
    PROGRAM Gcd C++";
    : cout << Enter two integers: ";
    : cin >> m >> n;
    : cout << "
    GCD (" << m<< ", " << n <<") = ";
    : while (n ! = 0) {
    : r = m % n;
    : m = n;
    : n = r;
    : }
    : cout << m << end;
    : }
    :
    : */
    :
    The "end" should be replaced with "endl"
  • ChovekaChoveka Member Posts: 1
    r = m % n; or
    r = m / n; ???
  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _____ < http://forcoder.org /> free video tutorials and ebooks about || Objective-C Python Swift PHP Go Scratch Assembly C++ JavaScript Visual Basic Delphi MATLAB Java Visual Basic .NET Ruby R Perl C PL/SQL C# LabVIEW ABAP Scala Logo Lua Alice VBScript Bash D Erlang Awk COBOL FoxPro Lisp Kotlin SAS Ada Transact-SQL Scheme ML Fortran Clojure F# Hack Dart Rust Crystal Apex Prolog Julia || ______

Sign In or Register to comment.