EmbLogic's Blog

Category Archives: Data Structures with C

Link list logfile. Batch 06.01.14

LINK LIST creation, traversal, insertion(all options) and deletion(all options) completed. RCS file: ll.c,v Working file: ll.c head: 1.7 branch: locks: strict root: 1.7 access list: symbolic names: keyword substitution: kv total revisions: 7;    selected revisions: 7 description: SINGLY LINKED LIST … Continue reading

Posted in Data Structures with C | Leave a comment

C program to compute area of triangle and square

#include int main() { int area,triangle,side,base,height; char ch; printf(“Enter s for area and t for triangle:”); scanf(“%c”,&ch); switch(ch) { case ‘s’: printf(“Enter side:”); scanf(“%d”,&side); area=side*side; printf(“Area of square = %dm^2\n”,area); break; case ‘t’: printf(“Enter base and hight:”); scanf(“%d%d”,&base,&height); area=(base*height)/2; printf(“Area … Continue reading

Posted in Data Structures with C | Leave a comment

Write a c program to add two array of size 10 and store the sum into third array

#include int main() { int i,a[10],b[10],c[10]; printf(“Enter the element of array1:\n”); for(i=0;i<10;i++) { scanf("%d",&a[i]); } printf("Enter the element of array2:\n"); for(i=0;i<10;i++) { scanf("%d",&b[i]); } printf("Element of array3 are:\n"); for(i=0;i<10;i++) { c[i]= a[i]+b[i]; printf("a[%d]+b[%d]=%d\n",i,i,c[i]); } }

Posted in Data Structures with C | Leave a comment

C program for digital clock

#include int main() { int sec=0,min=0,hour=0,i,j; while(1) { if(sec>59) { min++; sec=0; } if(min>59) { hour++; min=0; } if(hour>23) { hour=0; min=0; sec=0; } sleep(1); sec=sec+1; system(“clear”); printf(“\t\t%d:%d:%d\n”,hour,min,sec); } }

Posted in Data Structures with C | Leave a comment

C program for sorting an array in asscending order and binary searching

#include int main() { int i,j,a[100],b,n,c,low,mid,high; printf(“How many no. you want to add in an array:”); scanf(“%d”,&n); printf(“Enter element of array:\n”); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { for(j=i+1;ja[j]) { b=a[i]; a[i]=a[j]; a[j]=b; } } } printf(“Array after sorting is:\n”); for(i=0;ia[mid]) … Continue reading

Posted in Data Structures with C | Leave a comment

C program to merge two aaray

#include int main() { int a[100],b[100],i,j,k,l,c[100],m,n,o,x,y; printf(“How many no. do you want to add in array a[100]:”); scanf(“%d”,&n); printf(“Enter element of first array:\n”); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("How many no. do you want to add in array b[100]:"); scanf("%d",&o); printf("Enter … Continue reading

Posted in Data Structures with C | Leave a comment

Stack using array Logfile.

STACK implementation using array completed. RCS file: stack.c,v Working file: stack.c head: 1.4 branch: locks: strict root: 1.4 access list: symbolic names: keyword substitution: kv total revisions: 4;     selected revisions: 4 description: STACK MAIN PROGRAM. In initial rev 1.1 – … Continue reading

Posted in Data Structures with C | Leave a comment

C program for sorting an array in asscending order

#include<stdio.h> int main() { int a[100],i,j,n,temp; printf(“How many no. you want to add in an array:”); scanf(“%d”,&n); printf(“Enter element of an array:\n”); for(i=0;i<n;i++) { scanf(“%d”,&a[i]); } printf(“Array before sorting is:\n”); for(i=0;i<n;i++) { printf(“%d\n”,a[i]); } for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[j]) { … Continue reading

Posted in Data Structures with C | Leave a comment

FTP,TFTP & NFS server configuration..

today i configured FTP,TFTP & NFS servers……

Posted in Data Structures with C | Leave a comment

MDC 5 BIT COMPRESSION

MDC 5 BIT COMPRESSION: RCS file: compress_5.c,v Working file: compress_5.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1;    selected revisions: 1 description: 5 bit compression —————————- revision 1.1    locked by: root; … Continue reading

Posted in Data Structures with C | Leave a comment

simple ‘calculator’ using do-while…

1#include<stdio.h> 2 #include<math.h> 3 int main() 4 { int a,b,i; 5   printf(“\n\nenter two no.s : “); 6   scanf(“%d %d”,&a,&b); 7         do 8         { 9           printf(“\nenter 1 for ‘+’ : “); 10           printf(“\nenter 2 for ‘-’ : “); 11           printf(“\nenter 3 … Continue reading

Posted in Data Structures with C | Leave a comment

a prog. to find out Largest & smallest no. from given five no.s………..

1#include<stdio.h> 2 int main() 3 { 4 int x[5],l,s,i,j,k,z=0; 5 while(z<3) 6 { 7 printf(“\nenter any five numbers : “); 8 for(i=0;i<5;i++) 9 { 10         scanf(“%d”,&x[i]); 11 } 12 l=x[0]; 13 s=x[4]; 14 for(j=1;j<5;j++) 15 { 16  if(l<x[j]) 17  {  … Continue reading

Posted in Data Structures with C | Leave a comment

a simple program to add ‘n’ numbers…

1 #include<stdio.h> 2 int main() 3 { 4  int num[100],sum=0,n,i,ret; 5  printf(“enter the number of values u want 2 add\n”); 6  scanf(“%d”,&n); 7  printf(“enter the values\n”); 8  for(i=0;i<n;i++) 9   { 0   scanf(“%d”,&num[i]); 1   sum=sum+num[i]; 2   } 3   printf(“sum=%d\n”,sum); 4   ret … Continue reading

Posted in Data Structures with C | Leave a comment

FTP server configuration

day before yesterday i’ve learnt how to configure FTP server, & also added one group with some users in that server whose directory is in / & changed the ownership & permission given to group users using chmod command………….

Posted in Data Structures with C | Leave a comment

system administration

i’ve learnt today to create user with command-useradd, also difined user’s directory & shell,  using chown i’ve changed the user & group owner of the file & directory,  i also learnt the use of chmod,ll,userdel,passwd,ap,grep by practising them……

Posted in Data Structures with C | Leave a comment