Posts

Showing posts from May, 2021

DIGITAL CLOCK

 In this blog I  will be providing you with the code of making a simple clock using C Language.I hope that you will like it.   CODE:-   #include<stdio.h> #include<stdlib.h> void print1(char *x[20]){ //This is the function for printing the output i.e. a day ahead. char *day[20]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}; //above array is created to store the days. char *res[1];// this array is created to store the result. int i,flag,result; for(i=0;i<7;i++){     result=strcmp(x,day[i]);//This is used to compare two strings.If the two strings are same,then it will return a value0.*     if(result==0){         //* and if not then ,it will return a non zero number.         *res=*(day+i+1);         flag=1;     } } if(flag==1){     printf("%s",*res); }  ...

Circular linked List

 In this blog, I have provided you with the code of how can be dynamically create a circular linked list and how you can traverse,insert and delete in the linked list at the head,tail and at any index. IMPLEMENTATION IN C #include<stdio.h> #include<stdlib.h> struct student{     int marks;     struct student*next; }; int count; void display(struct student*head){     int i=0;     struct student*start;     start=head;     printf("Data of student %d is %d\n",i+1,start->marks);         i++;         start=start->next;     while(start!=head){         printf("Data of student %d is %d\n",i+1,start->marks);         i++;         start=start->next;              }   ...