#include int main(int argc, char *argv[], char *envp[]) { char buf[100]; // allocates space for array in memory char *ptr = malloc(100); // Dynamic memory allocation printf(”Hello world \n”); // Library call to print result on screen int fd = open(”/dir1/file”, O WRONLY, 0666); //System call to interpret string as file on disk *(ptr + 1000) = '\0'; // Segmentation fault as 1000 bytes are written to aloted space of 100 bytes //exception condition to signal some condition i code has been violated, trap is initiated write(fd, ptr, 100); // System call to write domething from disk close(fd); // System call to close the file exit(0); // Sys call to force return to some other program }