Write a program for print infinite numbers

Answers were Sorted based on User's Feedback



Write a program for print infinite numbers..

Answer / chavidi

void main()
{
int i=0;
while()
{
printf("%d",i)
i++;
}
}

Is This Answer Correct ?    25 Yes 12 No

Write a program for print infinite numbers..

Answer / shani jaiswal

main()
{
static int i=0;
printf("%d",i);
i++;
main();
return 0;
}

Is This Answer Correct ?    10 Yes 0 No

Write a program for print infinite numbers..

Answer / greg

#include <math.h>

static void checkinfinit(double x)
{
if (isinf())
{
printf("Infinite\n");
}
}

int main(int argc, char **argv, char **envp)
{
checkinfinite(1.0);
}

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C Interview Questions

write a program for size of a data type without using sizeof() operator?

22 Answers   HCL, IBM,


how do you execute a c program in unix.

0 Answers  


What is a segmentation fault?

2 Answers  


When is a “switch” statement preferable over an “if” statement?

0 Answers  


What is the best style for code layout in c?

0 Answers  


Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; }

3 Answers   Qualcomm,


What is volatile variable in c?

0 Answers  


Write a program to print all permutations of a given string.

0 Answers   JPMorgan Chase,


How does pointer work in c?

0 Answers  


write a program to print data of 5 five students with structures?

0 Answers  


main() { int i = 1; int num[] = {1,2,3,4}; num[i] = i++; printf("%d", num[i]); } what will be the output? }

22 Answers   NDS, TCS,


What is the purpose of sprintf() function?

0 Answers  


Categories