Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i wrote this program and im wondering whats the error in it i want it to check the length and the validity of the telephone

i wrote this program and im wondering whats the error in it i want it to check the length and the validity of the telephone number but when i try to put an input lets say i put 4743838abfc it still says valid number for the output which is wrong so what should i modify in order for it to work properly passing the input should be by argc and argv i cannot using anything else
image text in transcribed
image text in transcribed
please neglect the first photo it was by mistake the program is the second
000 W ES n.c X *validcheckc.c X validcheckch X 3 #include "validcheckc.h" 4 Fint qlc (char *str[]) { 5 6 if (str !=NULL && str[1]=='\0'){ 7 tele_val (str); 8 printf ("valid argument "); 9 } 10 return 0; 11 L} 12 Fint tele_val (char numb []) { 13 int i=0; 14 int count; 15 char *p=&numb[1]; 16 17 18 while(* (p++) != '\0') { 19 printf ("length is $d ", count); 20 count ++; 21 22 lif (numb[i]='0' && numb[i] #include Pirt lenghtt(char str 1251) char pte; irt count=0; pte=str; while (pte++) !='0'> count++; 1 printf ("length of string #d ", count); 1 Pirt tele_valchax numb11) int i=0; while (numb 4 10 el if (numb fil !=NULL 66 numb [i] !='\0') 1 2 3 4 5 6 7 8 9 0 1 2 2 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 if (numb ti]>='066 numb til

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

Develop successful mentoring programs. page 400

Answered: 1 week ago