EmbLogic's Blog

Author Archives: Amardeep Rawat

implementation of queue using link list is completed

#include #include struct queue { int data; struct queue *next; }*start=NULL,*new_node,*current; void qinsert(); void display(); void qdelete(); int front=0,rear=0; int main() { int choice; do { printf(“\n=========Main Menu========\n”); printf(“0.Exit\n”); printf(“1.Insert\n”); printf(“2.Delete\n”); printf(“3.Display\n”); printf(“\nEnter you choice:”); scanf(“%d”,&choice); switch(choice) { case 0: … Continue reading

Posted in Data Structures with C | Leave a comment

implementation of queue using array is done.

RCS file: main.c,v Working file: main.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: define function like: insert queue delete display ============================================================================= RCS file: header.h,v Working file: header.h head: branch: locks: strict access … Continue reading

Posted in Data Structures with C | Leave a comment

stack implemented successfully.

RCS file: main.c,v Working file: main.c head: 1.7 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 7; selected revisions: 7 description: creat main menu —————————- revision 1.7 date: 2014/07/25 09:18:02; author: root; state: Exp; lines: +1 … Continue reading

Posted in Data Structures with C, Uncategorized | Leave a comment

4 bit mdc successfully completed

RCS file: file.c,v Working file: file.c head: 1.16 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 16; selected revisions: 16 description: starting —————————- revision 1.16 date: 2014/07/21 12:28:16; author: amardeep; state: Exp; lines: +2 -2 add … Continue reading

Posted in Data Structures with C | Leave a comment

link list is completed successfully

RCS file: cw2.c,v Working file: cw2.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: link list is completed =============================================================================

Posted in Data Structures with C | Leave a comment

I have successfully compressed file.

RCS file: file.c,v Working file: file.c head: 1.9 branch: locks: strict amardeep: 1.9 access list: symbolic names: keyword substitution: kv total revisions: 9; selected revisions: 9 description: starting —————————- revision 1.9 locked by: amardeep; date: 2014/07/19 07:38:02; author: amardeep; state: … Continue reading

Posted in Uncategorized | Leave a comment

c program to find master array using rcs

I have created master array successfully.

Posted in Data Structures with C | Leave a comment

c program to find length of two string using function,pointer and memory allocation technique

#include #include char *input(); int length(char *); int main() { char *s1,*s2; int i; printf(“Enter string 1:”); s1=input(); printf(“Enter string 2:”); s2=input(); i=length(s1); printf(“Length of string is:%d\n”,i); } char *input() { char *s,ch; int i=0; s=(char *)malloc(sizeof(char)); while(1) { scanf(“%c”,&ch); … Continue reading

Posted in Uncategorized | Leave a comment

c program to compare two string using function,pointer and memory allocation technique

#include #include #include char *input(); int cmp(char * ,char *); int main() { char *a,*b; int i; printf(“Enter 1st string:”); a=input(); printf(“Enter 2nd string:”); b=input(); i=cmp(a,b); printf(“Comparision is=%d\n”,i); } char *input() { char *s1,ch; int i=0; s1=(char *)malloc(sizeof(char)); while(1) { … Continue reading

Posted in Data Structures with C | Leave a comment

c program to concatinate two string using function,pointer and memory allocation technique

#include #include #include char *con(char *s1,char *s2); char *input(); int main() { char *s1,*s2; int i=0; printf(“Enter string 1:”); s1=input(); printf(“Enter string 2:”); s2=input(); // strcat(s1,s2); s1=con(s1,s2); printf(“Concatination is: %s\n”,s1); } char *input() { char *s,ch; int i=0; s=(char *)malloc(sizeof(char)); … Continue reading

Posted in Data Structures with C | Leave a comment

c program for selection sort.

#include int main() { int a[100],i,j,small,n,k; printf(“Enter size of array:”); scanf(“%d”,&n); printf(“Enter element:\n”); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("Element and their position are:\n"); for(i=0;i<n;i++) { printf("%d\n",a[i]); } for(i=0;i<n;i++) { small=i; for(j=i;j<n;j++) { if(a[j]<a[small]) small=j; } k=a[small]; a[small]=a[i]; a[i]=k; } printf("Arrar after … Continue reading

Posted in Data Structures with C | Leave a comment

c program to compare two string without using string.h

#include int main() { char s1[5],s2[5]; int i,j,flag=0; printf(“Enter s1:”); scanf(“%s”,s1); printf(“Enter s2:”); scanf(“%s”,s2); for(i=0;i<5;i++) { if(s1[i]!=s2[i]) { j=s1[i]-s2[i]; flag=1; printf("return value: %d\n",j); break; } } if(flag==0) printf("string matched\n"); return 0; }

Posted in Data Structures with C | Leave a comment

c program to concatinate two string without using string.h

#include #include int main() { char a[20]={0},b[10]={0}; int i,j=0; printf(“Enter name1:\n”); scanf(“%s”,a); printf(“Enter second name:\n”); scanf(“%s”,b); for(i=0;i<20;i++) { if(a[i]=='') { a[i]=b[j]; j++; } } printf("Concatination is: %s\n",a); return 0; }

Posted in Data Structures with C | Leave a comment

c program to concatinate two string without using

#include #include int main() { char a[20]={0},b[10]={0}; int i,j=0; printf(“Enter name1:\n”); scanf(“%s”,a); printf(“Enter second name:\n”); scanf(“%s”,b); for(i=0;i<20;i++) { if(a[i]=='') { a[i]=b[j]; j++; } } printf("Concatination is: %s\n",a); return 0; }

Posted in Data Structures with C, Uncategorized | Leave a comment

c program to find string length using string.h

#include #include int main() { char s1[]=”Amar”,s2[]=”deep rawat”; int i,j; j=strcmp(s1,s2); if(j>0) printf(“S1 is greater than S2\n”); if(j<0) printf("S1 is smaller than s2\n"); strcat(s1,s2); printf("Concatination is:%s\n",s1); i=strlen(s1); printf("Length of string after concatination is:%d\n",i); return 0; }

Posted in Data Structures with C | Leave a comment