Principais perguntas e respostas de entrevista e testes online
Plataforma educacional para preparacao de entrevistas, testes online, tutoriais e pratica ao vivo

Desenvolva habilidades com trilhas de aprendizado focadas, simulados e conteudo pronto para entrevistas.

WithoutBook reune perguntas de entrevista por assunto, testes praticos online, tutoriais e guias comparativos em um unico espaco de aprendizado responsivo.

Preparar entrevista

Simulados

Definir como pagina inicial

Adicionar esta pagina aos favoritos

Assinar endereco de e-mail

C++ perguntas e respostas de entrevista

Test your skills through the online practice test: C++ Quiz Online Practice Test

Diferencas relacionadas

C vs C++Java vs C++

Pergunta 6. What are the advantages of inheritance?


It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 7. How do you write a function that can reverse a linked-list?


void reverselist(void)
{
if(head==0)
return;
if(head->next==0)
return;
if(head->next==tail)
{
head->next = 0;
tail->next = head;
}
else
{
node* pre = head;
node* cur = head->next;
node* curnext = cur->next;
head->next = 0;
cur-> next = head;

for(; curnext!=0; )
{
cur->next = pre;
pre = cur;
cur = curnext;
curnext = curnext->next;
}

curnext->next = cur;
}
}

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 8. What do you mean by inline function?

The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 9. Write a program that ask for user input from 5 to 9 then calculate the average


#include "iostream.h"
int main() {
int MAX = 4;
int total = 0;
int average;
int numb;
for (int i=0; i<MAX; i++) {
cout << "Please enter your input between 5 and 9: ";
cin >> numb;
while ( numb<5 || numb>9) {
cout << "Invalid input, please re-enter: ";
cin >> numb;
}
total = total + numb;
}
average = total/MAX;
cout << "The average number is: " << average << "n";
return 0;
}

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 10. Write a short code using C++ to print out all odd number from 1 to 100 using a for loop


for( unsigned int i = 1; i < = 100; i++ )
if( i & 0x00000001 )
cout << i << ",";
 

Isto e util? Adicionar comentario Ver comentarios
 

4) Write a program that ask for user input from 5 to 9 then calculate the average 5) Write a short code using C++ to print out all odd number from 1 to 100 using a for loop " />

Mais uteis segundo os usuarios:

Copyright © 2026, WithoutBook.