-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path25.c
More file actions
68 lines (55 loc) · 750 Bytes
/
25.c
File metadata and controls
68 lines (55 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*2.Write a program which accept number from user and check whether it contains 0
in it or not.
Input :
Output : 2395
There is no Zero
Input :
Output : 1018
It Contains Zero
Input :
Output : 9000
It Contains Zero
Input :
Output : 10687
It Contains Zero*/
#include<stdio.h>
#include<stdbool.h>
#define TRUE 1
#define FALSE 0
bool ChkZero(int iNo)
{
int iDigit=0;
int iCount=0;
if(iNo<0)
{
iNo=-iNo;
}
while(iNo!=0)
{
iDigit=iNo%10;
if(iDigit==0)
{
return 1;
}
iNo=iNo/10;
}
return 0;
}
int main()
{
int iValue=0;
bool
bRet=FALSE;
printf("Enter number");
scanf("%d",&iValue);
bRet = ChkZero(iValue);
if(bRet == TRUE)
{
printf("It Contains Zero");
}
else
{
printf("There is no Zero");
}
return 0;
}