Pseudocode


Joined
Oct 8, 2022
Messages
1
Reaction score
0
the teacher gives the task of making branching code, is this coding pseudocode or not?
Code:
#include<iostream>
using namespace std;

int main(){
    int jumlah;
    cout<<"jumlah buku yang anda pinjam = ";
    cin>>jumlah;
    
    if(jumlah< 2){
        cout << " buku telah berhasil dipinjam " <<endl;
    }else {
        jumlah;
        cout << "tidak dapat meminjam lebih dari 2 buku " <<endl;
    }
}
 
Ad

Advertisements

Joined
Mar 28, 2022
Messages
71
Reaction score
8
The given code is source code, a final version. It's not pseudocode.

Pseudocode is a sketch of the code that will later be produced.
It's like writing a document starting with a table of contents and then filling in details.

For example
Code:
// get user inputs x and y
// multiply them together
// present the answer
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top