Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions