Jump to content
Fórum Script Brasil
  • 0

Passar de Visualg para linguagem C


iskrtzz_

Question

Preciso passar o código abaixo para a linguagem C :

Algoritmo "simulaçao de disputa da thread"

Var

// Seção de Declarações das variáveis   

        randon: vetor[0..2] de inteiro

inst1, inst2, inst3: inteiro

i: inteiro

 

Inicio

// Seção de Comandos, procedimento, funções, operadores, etc... 

 

i <- 1

enquanto i < 20 faca

randon[0] <- 1

randon[1] <- 2

randon[2] <- 3

inst1 <- Randi (3)

inst2 <- Randi (3)

inst3 <- Randi (3)

 

escreval (randon[inst1])

escreval (randon[inst2])

escreval (randon[inst3])

i <- i+1

fimenquanto

fimalgoritmo

 

 
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.8k
×
×
  • Create New...