Pages

Monday, August 27, 2018

Predict C Program output - 4


Output of following C Programs are not very simple. These are simple but very interesting top c programs asked during viva and interviews.

Predict output of following C Programs:

Program-1

int main()
{
  printf("Hello\\rStudents");
  return 0;
}

Program-2

int main()
{
  printf("12345\r67890");
  return 0;
}

Program-3

int main()
{
  printf("12345678\r000");
  return 0;
}

Program-4

int main()
{
  printf("123\\\\456");
  return 0;
}

Program-5

int main()
{
  float n1, n2, total;
  n1 = 5.45;
  n2 = 6.54;
  total = n1 + n2;
  printf("%f", total);
  return 0;
}

Answer will be uploaded soon...


No comments:

Post a Comment