Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

https://www.chegg.com/homework-help/questions-and-answers/hi-im-trying-build-c-program-change-string-he2lo-hello--example-needs-able-achieve-result--q29646864 Could some one please please give me an in depth line by line explanation of whats happening in the above solution, especially this part====>

https://www.chegg.com/homework-help/questions-and-answers/hi-im-trying-build-c-program-change-string-he2lo-hello--example-needs-able-achieve-result--q29646864

Could some one please please give me an in depth line by line explanation of whats happening in the above solution, especially this part====> (str[i]-'0'); i'm having real trouble understanding this.

This is the code:

image text in transcribed

#include(3tdio.h> #include # include int main () char str [100],rep // ask user to enter string printf ("enter string:") scanf ("%s", str) ; int i,j,num; // now logic is simple traverse // given string and if we find any digit then // print next character by number of digit times for (lr) ; 3tr [1] '-'\0' ;1++) // check if current char is digit or not, means lies between 1 ascii value 49) to 9 num=0 ; // if there more consecutive digits that means they are forming a number so for a number first while(str[1]>-49 && 3tr[1]0) repstr[i] for (jr);jcnum ; j ++) printf ("SC",rep) continue // if not a digit then simply print current char on screen printf ("%c" , 3tr [1] ) ; printf ("n") 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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago