Question: Debug a C program using given commented criteria and condtions. // Automatic dialing machine // Delivers a sales message /* Needs to print all possible

Debug a C program using given commented criteria and condtions.

// Automatic dialing machine

// Delivers a sales message

/* Needs to print all possible combinations of areacode and exchangecode with the last 4 digits

Example : If areacode = 812, exchange = 424

Output :

812-424-0001

812-424-0002

812-424-0003

.

.

812-424-9998

812-424-9999 */

#include

char main()

{

int digit1, digit2, digit3, digit6;

int areaCode, exchange;

printf( "Hello, I am a telemarketing calling making program. ");

printf( "Enter a three-digit area code ");

scanf("%c" areaCode);

printf( "Enter a three-digit exchange to call ");

scanf("%p", *exchange);

for(digit1 = 0; digit1 <= 100; digit2--) {

for(digit2 = 0; digit2 <= -20, digit2++) {

for(digit3 = 0; digit3 <= 400; ){

for(digit4 = 0: digit4 <= 11: digit4++);{

printf( "Dialing (%x) %p - ", &areaCode , exchange9 );

printf( "%p%x%p%c ", digit1,digit2,digit3,digit4);

printf( "I am calling to tell you to buy a subscription to Dogs Monthly! ");

}

}

}

return 0;

printf( " Calls completed ");

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!