Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
dev c++, c programme, every character is displaced by a square
#include<stdio.h>
int main()
{
    char c;
    while((c=getchar()!=EOF))
    {
        putchar(c);//
    }
}

Every character of the output is displaced by '' these sorts of things.

enter image description here

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your parentheses are wrong so c gets assigned the value of the condition, which is 0 or 1 (false or true).

What you have now is the same as c = (getchar() != EOF) because of operator precedence.

Also, use the correct type for c, which is int:

#include<stdio.h>
int main()
{
    int c;
    while( (c = getchar()) != EOF )
    {
        putchar(c);//
    }
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda