notes on and related to umask

umask – set file mode creation mask #include <sys/types.h> #include <sys/stat.h> mode_t umask(mode_t mask); Binary Number ————–> Decimal Number Abstraction Decide the required result to decide the needed mask. Binary Number ——————-> Resultant Binary ANDing with mask

How to write an algorithm to do a binary to decimal conversion ?

/* part of work copied from http://www.sanfoundry.com/c-program-binary-number-into-decimal/ */ #include <stdio.h> btd() { int num, binary_val, decimal_val = 0, base = 1, rem; printf(“Enter a binary number : “); scanf(“%d”,&num); binary_val = num; while ( num > 0 ) { rem = num % 10; decimal_val = decimal_val + rem * base; num = num / …