Computer Science, asked by selsiya1, 3 months ago

WAP to input any number and find input number is integer or not​

Answers

Answered by reaper007
2
#include
#include
#include
int main()
{
char number[10];
int flag=0;
int length;
clrscr();
printf("Enter a number \n");
scanf("%s",number);
length=strlen(number);
while(length--)
{
if(number[length]=='.')
{
flag=1;
break;
}
}
if(flag)
printf("Floating point\n");
else
printf("Integer\n");

getch();
return 0;
}
Similar questions