#include<stdio.h> #include<stdlib.h> #include<fcntl.h> int open_file(char *); int creat_masterarray(int ); int find_loc(char , char *, int); int code_length(int ); int open_file(char *filename) { int fd; fd = open(filename,O_RDONLY); if(fd<0) { perror(“open”); goto OUT; } printf(“File Opened Successfully. fd = %d\n”,fd); return … Continue reading
#include<stdio.h> int main() { int n,even=0,odd=0; float sumodd=0,sumeven=0; scanf(“%d”,&n); while(n!=0) { if(n%2==0) { even++; sumeven=sumeven+n; } else { odd++; sumodd=sumodd+n; } scanf(“%d”,&n); } printf(“\nTotal even num are %d nd Their Average is %f \n “, even, sumeven/even ); printf(“Total odd … Continue reading
#include<stdio.h> #include<stdlib.h> struct disfeet { int *f; }; struct distance { struct disfeet *d; }; int main() { struct distance *d1; d1=(struct distance *)malloc(sizeof(struct distance)); d1->d=(struct disfeet *)malloc(sizeof(struct disfeet)); d1->d->f=(int *)malloc(sizeof(int)); printf(“enter distance\n”); scanf(“%d”,&d1->d->f); printf(“distance is %d feet.\n\n”,d1->d->f); return 0; … Continue reading