EmbLogic's Blog

addition of distance in feet and inches

1 head    2.1;
2 access;
3 symbols;
4 locks
5         emblogic:1.1; strict;
6 comment @ * @;
7
8
9 1.1
10 date    2015.02.21.05.39.49;    author emblogic;        state Exp;
11 branches;
12 next    ;
13
14
15 desc
16 @This programme will calculate the distance in feet and inches
17 @
18
19
20 1.1
21 log
22 @Initial revision
23 @
24 text
25 @#include<stdio.h>
26 int main()
27 {
28         float  feet, inch,feet1,feet2,inch1,inch2;
29         printf(“enter 1st distance in feet\n”);
30         scanf(“%f”, &feet1);
31         printf(“enter 1st distance in inches\n”);
32         scanf(“%f”, &inch1);
33         printf(“enter 2nd distance in feet\n”);
34         scanf(“%f”, &feet2);
35         printf(“enter 2nd distance in inches\n”);
36         scanf(“%f”, &inch2);
37         feet= feet1 + feet2;
38         inch=inch1 + inch2;
39         if (inch > 12)
40         {
41         inch=inch – 12;
42         feet++;
43         printf(“%4.2f\n”, feet);
44         printf(“%4.2f\n”, inch);
45         }
46         return 0;
47         }
48 @
~
– INSERT –                                                                                                                                                                  1,7-10        All

Posted in Uncategorized | Leave a comment

3 bit mdc successfully done.

RCS file: mdc.c,v
Working file: mdc.c
head: 1.18
branch:
locks: strict
root: 1.18
access list:
symbolic names:
keyword substitution: kv
total revisions: 18; selected revisions: 18
description:
This is mdc.c file.
here function are implemented.
—————————-
revision 1.18 locked by: root;
date: 2015/02/20 10:32:51; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.17
date: 2015/02/20 10:30:01; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2015/02/20 10:29:16; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.15
date: 2015/02/20 10:27:15; author: root; state: Exp; lines: +8 -1
*** empty log message ***
—————————-
revision 1.14
date: 2015/02/20 10:24:07; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2015/02/20 10:22:12; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.12
date: 2015/02/20 10:21:19; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/02/20 10:20:30; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.10
date: 2015/02/20 10:18:50; author: root; state: Exp; lines: +35 -4
implement function for decompression.
—————————-
revision 1.9
date: 2015/02/20 09:40:05; author: root; state: Exp; lines: +1 -5
*** empty log message ***
—————————-
revision 1.8
date: 2015/02/20 09:38:20; author: root; state: Exp; lines: +1 -0
write byte into file.
—————————-
revision 1.7
date: 2015/02/20 09:36:56; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2015/02/20 09:35:02; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.5
date: 2015/02/20 09:32:04; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/20 09:21:50; author: root; state: Exp; lines: +4 -1
print byte.
—————————-
revision 1.3
date: 2015/02/20 09:17:39; author: root; state: Exp; lines: +45 -4
implement function for 3 bit compression.
—————————-
revision 1.2
date: 2015/02/20 08:29:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2015/02/20 08:27:26; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 2: Multiple Data Compression and Encryption | Leave a comment

Add two distance in feet and inches and convert the sum into meter and centimeter and to display the both.

RCS file: q2.c,v
Working file: q2.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
in this i have created input() to enter two distance in feet and inches.
—————————-
revision 1.4    locked by: root;
date: 2015/02/20 10:56:32;  author: root;  state: Exp;  lines: +8 -4
created display() to display the sum of distance in feet and inches
then display the converted value of feet and inches to meter and centimeter
—————————-
revision 1.3
date: 2015/02/20 10:48:31;  author: root;  state: Exp;  lines: +14 -1
created convert() to convert sum of distance in feet and inches to meter and centimeter
—————————-
revision 1.2
date: 2015/02/20 10:23:45;  author: root;  state: Exp;  lines: +16 -1
created adddist() to add two distances in feets and inches.
—————————-
revision 1.1
date: 2015/02/20 09:58:12;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: func_header.h,v
Working file: func_header.h
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
declared the prototype for input()
created nested structure struct distance ,struct distmeter,struct distfeet
—————————-
revision 1.4    locked by: root;
date: 2015/02/20 10:58:39;  author: root;  state: Exp;  lines: +1 -0
declared the prototype for display()
—————————-
revision 1.3
date: 2015/02/20 10:50:04;  author: root;  state: Exp;  lines: +1 -0
declared the prototype for convert()
—————————-
revision 1.2
date: 2015/02/20 10:24:46;  author: root;  state: Exp;  lines: +1 -0
declared the prototype for adddist()
—————————-
revision 1.1
date: 2015/02/20 09:58:46;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Added two distances in feet and inches and then converted it into meters and centimeters..

RCS file: q2.c,v
Working file: q2.c
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
implementation of nested structure
in this we have converted feet-inches into metres nd then into cm .
----------------------------
revision 1.1	locked by: root;
date: 2015/02/19 09:22:05;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header_nested.h,v
Working file: header_nested.h
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
Implementation of nested structures.
Decleared the prototypes for the distance,distfeet,distmeters
----------------------------
revision 1.1	locked by: root;
date: 2015/02/20 05:35:34;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: q2_functions.c,v
Working file: q2_functions.c
head: 1.4
branch:
locks: strict
	root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
in this i have created the input() to enter the two distances.
----------------------------
revision 1.4	locked by: root;
date: 2015/02/20 10:56:30;  author: root;  state: Exp;  lines: +9 -5
nw i have created the display()
for displaying the values
----------------------------
revision 1.3
date: 2015/02/20 10:48:27;  author: root;  state: Exp;  lines: +17 -3
nw i have created convert() for converting feet into inches 
after that converted inches into cmeters
and then cmeters into meters
----------------------------
revision 1.2
date: 2015/02/20 10:23:25;  author: root;  state: Exp;  lines: +17 -1
nw i have created adddist() for adding the two distances.
----------------------------
revision 1.1
date: 2015/02/20 09:58:03;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header_nested.h,v
Working file: header_nested.h
head: 1.5
branch:
locks: strict
	root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;	selected revisions: 5
description:
Implementation of nested structures.
Decleared the prototypes for the distance,distfeet,distmeters
----------------------------
revision 1.5	locked by: root;
date: 2015/02/20 10:57:37;  author: root;  state: Exp;  lines: +1 -0
just created the prototype for display()
----------------------------
revision 1.4
date: 2015/02/20 10:50:12;  author: root;  state: Exp;  lines: +1 -0
created the prototype for convert()
----------------------------
revision 1.3
date: 2015/02/20 10:24:32;  author: root;  state: Exp;  lines: +1 -1
created the prototype for adddist()
----------------------------
revision 1.2
date: 2015/02/20 09:58:34;  author: root;  state: Exp;  lines: +1 -0
just decleared the prototype for input()
----------------------------
revision 1.1
date: 2015/02/20 05:35:34;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

Finding out largest number & the smallest number.

RCS file: largest.c,v
Working file: largest.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
this is abt
—————————-
revision 1.2 locked by: root;
date: 2015/02/20 08:50:26; author: root; state: Exp; lines: +22 -12
initialised a after scanf
—————————-
revision 1.1
date: 2015/02/20 07:30:12; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Data Structures with C | Leave a comment

Implementation of nested structures..

RCS file: q2.c,v
Working file: q2.c
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
implementation of nested structure
in this we have converted feet-inches into metres nd then into cm .
----------------------------
revision 1.1	locked by: root;
date: 2015/02/19 09:22:05;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header_nested.h,v
Working file: header_nested.h
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
Implementation of nested structures.
Decleared the prototypes for the distance,distfeet,distmeters
----------------------------
revision 1.1	locked by: root;
date: 2015/02/20 05:35:34;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

Smaller and Greater among 5 Numbers

#include<stdio.h>
int main()
{
int a,b,c,d,e,largest,smallest;
printf(“enter five integers\n”);
scanf(“%d%d%d%d%d”, &a,&b,&c,&d,&e);
largest = a;
if (b > largest)
{
largest=b;
}
if (c > largest)
{
largest=c;
}
if (d > largest)
{
largest=d;
}
if (e > largest)
{
largest=e;
}
printf(“largest number is  = %d\n”,largest);
smallest = a;
if (b < smallest)
{
smallest=b;
}
if (c < smallest)
{
smallest=c;
}
if (d < smallest)
{
smallest=d;
}
if (e < smallest)
{
smallest=e;
}
printf(“smallest number is  = %d\n”,smallest);
return 0;
}

Posted in Uncategorized | Leave a comment

multiple data compression


RCS file: merge.c,v
Working file: merge.c
head: 1.2
branch:
locks: strict
	prachisinghal: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
merge two arrays using pointer.
----------------------------
revision 1.2	locked by: prachisinghal;
date: 2015/02/13 08:08:21;  author:
prachisinghal;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.1
date: 2015/02/13 07:52:22;  author:
prachisinghal;  state: Exp;
Initial revision
=============================================================================

RCS file: mdc.c,v
Working file: mdc.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
opening a file
----------------------------
revision 1.3	locked by: root;
date: 2015/02/14 10:51:24;  author: root; 
state: Exp;  lines: +25 -13
find the compressed data
----------------------------
revision 1.2
date: 2015/02/14 09:58:30;  author: root; 
state: Exp;  lines: +47 -2
inserting distinct characters from textfile into
master array
----------------------------
revision 1.1
date: 2015/02/13 15:27:34;  author: root; 
state: Exp;
Initial revision
=============================================================================

RCS file: mdc.c,v
Working file: mdc.c
head: 1.4
branch:
locks: strict
	root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
opening a file
----------------------------
revision 1.4	locked by: root;
date: 2015/02/19 17:39:41;  author: root; 
state: Exp;  lines: +55 -7
compress the code
----------------------------
revision 1.3
date: 2015/02/14 10:51:24;  author: root; 
state: Exp;  lines: +25 -13
find the compressed data
----------------------------
revision 1.2
date: 2015/02/14 09:58:30;  author: root; 
state: Exp;  lines: +47 -2
inserting distinct characters from textfile into
master array
----------------------------
revision 1.1
date: 2015/02/13 15:27:34;  author: root; 
state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

weekly wage with Overtime

 

 

1 #include <stdio.h>
2 int main()
3 {
4         int a,b,c, pay1, pay2, pay;
5         printf(“enter daily working hours\n”);
6         scanf(“%d”, &a);
7         b= a * 6;
8         printf(“weakly hours are %d\n”, b);
9         if (b > 40)
10         {
11         c= b – 40;
12         printf(“%d is overtime\n”, c);
13         }
14         else
15         {
16         c=0;
17         }
18         if (b > 40)
19         {
20         pay1= 40 * 300;
21         pay2=c * 400;
22         pay= pay1 + pay2;
23         printf(“pay is %d”,pay );
24         }
25         else
26         {
27         pay = b * 300;
28         printf(“pay is %d”, pay);}return 0;
29         return 0;
30 }
~

Posted in Uncategorized | Leave a comment

Area of Triangle or Square

1 #include <stdio.h>
2 int main()
3 {
4         int side, base, height,choice,AOT,AOS;
5         printf(“enter side\n”);
6         scanf(“%d”, &side);
7         printf(“enter base\n”);
8         scanf(“%d”, &base);
9         printf(“enter height\n”);
10         scanf(“%d”, &height);
11         printf(“1=AOT\n”);
12         printf(“2=AOS\n”);
13         scanf(“%d”,&choice);
14         switch(choice)
15         {
16                 case 1: AOT=(base*height)/2;
17                 printf(“%d”, AOT);
18                 break;
19                 case 2: AOS=side*side;
20                 printf(“%d”, AOS);
21                 break;
22                 }
23                 return 0;
24         }
~

Posted in Uncategorized | Leave a comment

Implementing structure using function

RCS file: q1_functions.c,v
Working file: q1_functions.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
implementations of structures by using functions
—————————-
revision 1.1    locked by: root;
date: 2015/02/19 10:13:13;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: func_header.h,v
Working file: func_header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
decleared prototype for input()and display()
—————————-
revision 1.1    locked by: root;
date: 2015/02/19 10:39:43;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Reverse the digits

1        #include <stdio.h>
2        int main()
3        {
4         long int a=0;
5         long int n;
6         printf(“enter a number\n”);
7         scanf(“%ld”, &n);
8         while(n!=0)
9         {
10                 a=a*10;
11                 a=a+(n%10);
12                 n=n/10;
13                 }
14                 printf(“%ld”,a);
15                 return 0;
16                 }

Posted in Uncategorized | Leave a comment

Number: Positive or Negative

1        #include <stdio.h>
2        int main()
3        {
4         int a;
5         printf(“enter a number\n”);
6         scanf(“%d”, &a);
7         if(a > 0)
8         {
9         printf(“it is positive\n”);
10         }
11         else if(a < 0)
12         {
13                 printf(“it is negative\n”);
14         }
15         else
16         {
17                 printf(“it is zero\n”);
18         }
19 }
~

Posted in Uncategorized | Leave a comment

Performed 4 bit Decompression

RCS file: mdc.c,v
Working file: mdc.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
This is the base file for mdc project….
—————————-
revision 1.5 locked by: root;
date: 2015/02/19 10:33:26; author: root; state: Exp; lines: +30 -8
4 BIT COMPRESSION HAS BEEN PERFORMED.
HERE, DECOMPRESSION IS DONE AND FILE IS DECRYPTED.
—————————-
revision 1.4
date: 2015/02/13 10:31:50; author: root; state: Exp; lines: +83 -8
MASTER ARRAY HAS BEEN CREATED AND CODE LENGTH HAS BEEN CALCULATED
HERE 4 BIT COMPRESSION HAS BEEN PERFORMED
COMPRESSED DATA IS STORED IN A SEPARATE FILE COMPRESS.TXT.
—————————-
revision 1.3
date: 2015/02/07 17:58:40; author: root; state: Exp; lines: +73 -15
Created “MASTER ARRAY” and calculated CODE LENGTH.
—————————-
revision 1.2
date: 2015/02/05 10:46:55; author: root; state: Exp; lines: +16 -9
Here after opening the file…the file data is stored in a master array and array is printed…
master array is declared using concept of pointer and malloc.
memory is allocated dynamically using realloc().
—————————-
revision 1.1
date: 2015/02/05 08:05:18; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 2: Multiple Data Compression and Encryption | Leave a comment

add distance in feets and inches

1         #include<stdio.h>
2          int main()
3         {
4         float  feet, inch,feet1,feet2,inch1,inch2;
5         printf(“enter 1st distance in feet\n”);
6         scanf(“%f”, &feet1);
7         printf(“enter 1st distance in inches\n”);
8         scanf(“%f”, &inch1);
9         printf(“enter 2nd distance in feet\n”);
10         scanf(“%f”, &feet2);
11         printf(“enter 2nd distance in inches\n”);
12         scanf(“%f”, &inch2);
13         feet= feet1 + feet2;
14         inch=inch1 + inch2;
15         if (inch > 12)
16         {
17         inch=inch – 12;
18         feet++;
19         printf(“%4.2f\n”, feet);
20         printf(“%4.2f\n”, inch);
21         }
22         return 0;
23         }
~
~
~

Posted in Uncategorized | Leave a comment