Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Što ne valja kod ovog koda?
Author Message
Mr.JA Offline
Novi korisnik
*

Posts: 58
Joined: Jul 2008
Reputation: 0
Post: #1
Što ne valja kod ovog koda?
ljudi ne kužim šta ode ne valja- stvarno ne kužim...
pomoć!

Code:
#include<iostream>
using namespace std;
int main ()
{
    int brojgodina;
    cout<<("koliko imate godina: ");
    cin>>brojgodina;
    if (brojgodina>18);
     {
         cout<<("dobro dosli u stranicu za odrasle");
      }
    else
     {
         cout<<("zao mi je pre mladi ste");
     }
    system("pause");
    return 0;
}
09-08-2008 03:02 PM
Find all posts by this user Quote this message in a reply
Gogy Offline
____
*

Posts: 2,379
Joined: Feb 2006
Post: #2
RE: pitanje?
Šta će ti ove zagrade kod ispisivanja cout-om? I BTW pripazi kako imenuješ teme.

Pravila foruma | Twitter - Facebook - Google+ |
09-08-2008 08:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Milk Offline
Novi korisnik
*

Posts: 1
Joined: Aug 2008
Reputation: 0
Post: #3
RE: Što ne valja kod ovog koda?
Mr.JA Wrote:ljudi ne kužim šta ode ne valja- stvarno ne kužim...
pomoć!

Code:
#include<iostream>
using namespace std;
int main ()
{
    int brojgodina;
    cout<<("koliko imate godina: ");
    cin>>brojgodina;
    if (brojgodina>18);
     {
         cout<<("dobro dosli u stranicu za odrasle");
      }
    else
     {
         cout<<("zao mi je pre mladi ste");
     }
    system("pause");
    return 0;
}


Ne trabaju ti ove zagrade kod cout<<"Koliko imate godina";
I mislim da ti ne treba ; poslije if(brojgodina>18)
21-08-2008 01:28 AM
Find all posts by this user Quote this message in a reply
jasko_bh Offline
Novi korisnik
*

Posts: 1
Joined: Nov 2008
Reputation: 0
Post: #4
RE: Što ne valja kod ovog koda?
evo ti ovaj ispravan
#include<iostream>

using namespace std;

void main ()
{
int x;
cout <<"koliko imate godina" <<endl;
cin >> x;
if (x < 18)
{
cout << " zao nam je premladi ste " <<endl;
}
else
{
cout << " dobro dosli na stranicu za odrasle"<< endl;
}
system ("PAUSE");
}
20-11-2008 11:00 PM
Find all posts by this user Quote this message in a reply
schmrz Offline
____
*

Posts: 567
Joined: Feb 2007
Post: #5
RE: Što ne valja kod ovog koda?
Nije mi jasno zasto svi novi koji dodu na ovaj forum moraju da daju odgovor na temu staru nekoliko mjeseci...

I have no drinking problems. I drink. Get drunk. Fall down. NO PROBLEM
Registered As Linux User #484215
Moj skromni blog
Savjet za buduće programere: ovdje
20-11-2008 11:13 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)