Buscar

What is the output of the following C programs? Program 1 prints a sequence of numbers that starts at 233 and ends at 458, printing each number on ...

What is the output of the following C programs?
Program 1 prints a sequence of numbers that starts at 233 and ends at 458, printing each number on a new line. If the number is between 300 and 400, it adds 3 to the counter, otherwise it adds 5.
Program 2 reads an integer k and another integer n. It then calculates the sum of the first n multiples of k and prints the result.
Program 3 reads a name, an address, a DDD, a phone number, and two passwords. It then prints a summary of the data entered, including the name, the number of characters in the name (excluding spaces), the address, the phone number (DDD + number), and whether the two passwords match.

a) Program 1: prints a sequence of numbers from 233 to 458, adding 5 to the counter each time. Program 2: reads two integers and prints their sum. Program 3: reads personal data and prints a summary.
b) Program 1: prints a sequence of numbers from 233 to 458, adding 3 to the counter if it is between 300 and 400, and 5 otherwise. Program 2: reads two integers and prints the sum of the first n multiples of k. Program 3: reads personal data and prints a summary.
c) Program 1: prints a sequence of numbers from 233 to 456, adding 3 to the counter if it is between 300 and 400, and 5 otherwise. Program 2: reads two integers and prints the sum of the first n multiples of k. Program 3: reads personal data and prints a summary.

Essa pergunta também está no material:

Avaliação 2 - Algoritmos e Programação
3 pág.

Algoritmo e Programação Universidade Federal do PampaUniversidade Federal do Pampa

💡 1 Resposta

User badge image

Ed Verified user icon

A alternativa correta é a letra B: Programa 1: imprime uma sequência de números de 233 a 458, adicionando 3 ao contador se estiver entre 300 e 400 e 5 caso contrário. Programa 2: lê dois inteiros e imprime a soma dos primeiros n múltiplos de k. Programa 3: lê dados pessoais e imprime um resumo.

0
Dislike0

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Você também pode ser Premium ajudando estudantes

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais