Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include<ctype.h>
- int main()
- {
- int input;
- int valid = 2; // 2 for unused value // valid is the checking of string
- int count = 0;
- printf("Enter the decimal input :");
- scanf("%d",&input);
- if (input)
- {
- if (input % 2 == 0)
- {
- valid = 1;
- }
- else
- {
- valid = 0;
- }
- }
- else
- {
- printf("Your inputs should be atleast 3.");
- }
- switch (valid)
- {
- case 1:
- {
- printf("Congrats, Your string is valid \n");
- break;
- }
- case 0:
- {
- printf("Your string is not valid\n");
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement