K&R C Programs Exercise 4-10

Exercise 4-10. An alternate organization uses getline to read an entire input line; this makes getch and ungetch unnecessary. Revise the calculator to use this approach. The original calculator reads the input one character at a time via getch/ungetch. This exercise replaces that machinery with a line-buffer approach: read the whole line into a static …

K&R C Programs Exercise 4-9

Exercise 4-9. Our getch and ungetch do not handle a pushed-back EOF correctly. Decide what their properties should be if an EOF is pushed back, then implement your decision. The bug: K&R’s original implementation uses char buf[BUFSIZE]. When ungetch(EOF) is called, EOF (typically -1) is stored as char. On platforms where char is unsigned, -1 …

C Program which produces its own source code as its output.

Write a c program which produces its own source code as its output.This C program uses the C File i/o operations like fopen(), fclose(). In this program, We pritn the source code of the program.Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for personal and learning purposes. …

C Program to print ASCII values of all characters.

C Program to print ASCII values of all characters.ASCII value is the American Standard Code for Information Interchange.ASCII value is the numerical value, or order, of an character. There are 128 standard ASCII characters, numbered from 0 to 127. Extended ASCII adds another 128 values and goes to 255. The numbers are typically represented in …

C Program to find the strong number.

Write a C Program to find the given number is strong or not?A number is called strong number if sum of the factorial of its digit is equal to number itself. Example: 145 since 1! + 4! + 5! = 1 + 24 + 120 = 145. Read more about C Programming Language . /************************************************************ …

C Program to find the two sets Intersection and Union

Write a C Program to find the two sets Intersection and UnionA Set is a collection of well defined and distinct objects.Intersection of two sets A and B is defined as, all the elements of set A, which are also elements of set B.Union of two sets A and B is defined as, all the …