Translate the following expression into prefix form
\(\dfrac{5 + 4 + (2 - (3 - (6 + \dfrac{4}{3})))}{3(6 - 2) (2-7)}\)
\(\dfrac{5 + 4 + (2 - (3 - (6 + \dfrac{4}{3})))}{3(6 - 2) (2-7)}\)
Below is a sequence of expressions. What is the result printed by the interpretter in response to each expression ? Assume that sequence is to be evaluated in the order in which it is presented.
Similarly how there was formatted print function for stdio
, there are function that could be used with file.
We could apply all the formatting tricks that was used for printf
and scanf
.
Write the function htoi(s) which converts a string of hexadecimal digits (including an optional 0x, 0X) into its equivalent integer value. Allowable digits are 0..9, a through f, A through F.
This article go through several API related file operation. Linux/Unix core philosophy is that everything is a file. Hence file operations becomes core of any application/system programming. Hence for a person who claims to be good at 'C' need to know the file operation really well. In this series of article it introduces all the API with example it it never tries to exhaustive, for which you can always refer man pages.
Write a loop equivalent to the for loop below without using && or ||.
for(i=0; i < lim -1 && (c=getchar()) != '\n' && c != EOF; ++i) s[i] = c;
This article explains format specifier %n which can be used in printf. Already other format specifiers are covered C Programming #87: stdio - printf, scanf and C Programming #88: stdio - insane formating in printf.
Write a Program to determine the ranges of char, short, int and long variables. Both signed and unsigned by printing appropriate values from standard header and by direct computation. Harder if you compute them determine the ranges of various floating point types.
We have covered simple format specifier for printf and scanf here [C Programming #87: stdio - printf, scanf]. This article tries to give incrementally with example most complex and insane formatting that could be achieved. I don't expect you to remember all of it. My idea to here is to show how beautiful and complex the construct are.
Write a program to check a C program for rudimentary syntax errors like unbalanced parenthesis brackets and braces. Don't forget about quotes both single and double, escape sequence and comments. (This program is hard, if you do it in full generality).
Following article explores formatted stdio functions printf
and scanf
.
printf and scanf are varidac function (function that take variable arguments).
Variable argument function are covered in later articles.
Write a program to remove all comments from a c program, don't forget to handle quoted strings and character constants properly. C comments do not nest.