Coder Social home page Coder Social logo

hiverkiya / dennis-ritchie-c-solutions Goto Github PK

View Code? Open in Web Editor NEW
30.0 1.0 17.0 20.48 MB

Solutions to Second Edition of Dennis-Ritchie's Book

Home Page: https://hiverkiya.github.io/Dennis-Ritchie-C-Solutions/

License: MIT License

C 100.00%
c-programming dennis-ritchie solutions hacktoberfest-accepted

dennis-ritchie-c-solutions's Issues

Question regarding your solution of chapter 1 exercise 16.

Exercise 1-16. Revise the main routine of the longest-line program so it will correctly print the length of arbitrary long input lines, and as much as possible of the text.

in your solution to the aforementioned problem, you seem to not have solved it at all. Also the main block does not seem to have a return value. Am I wrong in my understanding?

Thank you in advance.

Exercise 1.12 - Print the input one word per line.c

Your code will not work if there is tab between words. try this

#include<stdio.h>
int main(){
     int c=0;
     int state=0;
     while((c=getchar())!=EOF){
         if((c==' '||c=='\t'||c=='\n')&&state==1){
             putchar('\n');
             state=0;
         }
        else{
             putchar(c);
             state=1;
         }
     }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.