Pattern Codes, ABCDE Code, Arduino Code

Friday 20 January 2017

J2EE

Java History


  • 1996 - JDK 1.6
  • 1992 - *7 - Product a remote control
  • Green project restarted in collabration with Netscape and Sun Microsystem
  • in 1994 - first person
  • Applet was first interactive program on internet
Sun Microsystem

  1. Brought a browser "Not Java"
  2. 1996 - JDK 1.0
  3. In 1998 Sun Microsystem revealed 3 flavours.
1998 java
  • J2SE - Core Java
  • J2EE- Advanced Java
  • J2ME
JDK History
  • 2000 - JDK 1.3
  • 2002 - JDk 1.4
  • 2004 - JDK 1.5
  • 2006 - JDK 1.6
  • 2007 - JDK 1.7
  • 2014 - JDK 1.8
  • 2017 - JDK 1.9
Web application is done in J2EE
1998 - 1st open source technology

Introduction to Java EE
  • 2 from Java2EE is dropped after java1.5
Objective of the Session

Enterprise Software
  1. EAS(Enterprise Application Software) Group of people who came together for specific purpose on one application is known as EAS. Eg:- Facebook, Shopping site
  2. It can be any software that is accessing server for data solution.
EAS are expected to posses following characteristics
  1. Performance
  2. Scalability
  3. Robustness
  4. Security
  5. Reliability and Availability

Tuesday 17 January 2017

Two Highest elements in Array

Two Highest elements in Array

Output:
 enter the elements in array14
5
2
36
7
8
54
21
1
12
1452367854211121 2 5 7 8 12 14 21 36 54
 two highest element in array are 21 and 36
 and there sum is 57

Code:
#include<stdio.h>

int main()
{
int arr[20];
int i,j,n,temp = 0;
printf("\n enter the elements in array");
for(i=0;i<10;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<10;i++)
{
printf("%d",arr[i]);
}
for(i=0;i<10;i++)
{
for(j=0;j<10-i-1;j++)
{
if(arr[j]>arr[j+1])
{
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1]=temp;
}
}
}
for(i=0;i<10;i++)
{
printf("%d ",arr[i]);
}
printf("\n two highest element in array are %d and %d",arr[10-3],arr[10-2]);
printf("\n and there sum is %d",(arr[10-3]+arr[10-2]));
}

Monday 16 January 2017

2X2 Matrix

Program To Print 2X2 matrix

Output:

    Enter the values in matrix
88
99
44
55

 MATRIX REPRESENTATION
[  88  99]
[  44  55]

Code:
#include<stdio.h>

int main()
{
int arr[10][10]; //size of matrx
int i,j;
printf("\n  Enter the values in matrix \n");
for(i=0;i<2;i++) //size can be increased as per user req
{
for(j=0;j<2;j++)
{
scanf("%d",&arr[i][j]);
}
}
for(i=0;i<2;i++)
{
printf("[");
for(j=0;j<2;j++)
{
printf("  %d",arr[i][j]);
}
printf("]");
printf("\n");
}
}

Sunday 15 January 2017

Sum of two Number in C

Sum of Two numbers

Code:

#include<stdio.h>

int main()
{
     int num1,num2, sum;
     printf("\n Enter the number of your choice");
     scanf("%d%d",&num1,&num2);
     sum = num1 + num2;
     printf("\n Sum of two numbers %d and %d is  =  %d",num1,num2,sum);
     getch();
     return 0;
}

Palindrome number

To check number is palindrome or not

Output:

 Enter the number to check whether it is palindrome or not12321


 Number is palindrome 12321 = 12321

Code:

#include<stdio.h>

int main()
{
int rem,div,n,temp,sum =0;
printf("\n Enter the number to check whether it is palindrome or not");
scanf("%d",&n);
temp = n;
while(n!=0)
{
rem = n%10;
div = n/10;
sum = sum*10 + rem;
n = div;
}
if(sum == temp)
{
printf("\n Number is palindrome %d = %d ",temp,sum);
}
else
{
printf("\n Number is not palindrome %d != %d",temp,sum);
}
}

Saturday 14 January 2017

Repeated Number in Array

Repeated number in array:

Output:

 Enter the number in array 8
5
6
4
5
1
2
 8 5 6 4 5 1 2

 Repeated number is :: 5

Code:

#include<stdio.h>

int main()
{
int arr[20];
int arr2[20];
int n,count=0,i,j;
printf("\n Enter the number in array ");
for(i=0;i<=6;i++)
{ //input array elements
scanf("%d",&arr[i]);
}
for(i=0;i<=6;i++)
{ //print array elements
printf(" %d",arr[i]);
}
printf("\n Repeated number is :: ");
for(i=0;i<=6;i++)
{ //loop for checking the repeated elements
for(j=i+1;j<=6;j++)
{
if(arr[i] == arr[j])
{
printf("%d ",arr[i]);
}
}
}
}

Bubble Sorting

Bubble Sort
output:
 enter the elements in array
8
9
25
8
51
3
66
23
95
75

 Before Sorting  8 9 25 8 51 3 66 23 95 75


After Sorting  3 8 8 9 23 25 51 66 75 95
-----------------------------------------------------------------------------------------------------
#include<stdio.h>

int main()
{
int arr[20];
int i,j,n,temp = 0;
printf("\n enter the elements in array \n");
for(i=0;i<10;i++)
{
scanf("%d",&arr[i]);

printf("\n Before Sorting  ");
for(i=0;i<10;i++)
{
printf("%d ",arr[i]);
}
for(i=0;i<10;i++)
{
for(j=0;j<10-i-1;j++)
{
if(arr[j]>arr[j+1])
{
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1]=temp;
}
}
}
printf("\n\n");
printf("After Sorting  ");
for(i=0;i<10;i++)
{
printf("%d ",arr[i]);
}
 }

Reverse Right Angle Triangle Star Pattern

Reverse Right Angle Triangle Star Pattern

Output:

Enter the number of your choice5

*****
 ****
  ***
   **
    *

Code:

#include<stdio.h>

int main()
 {
int i,j,k, n;
printf("\n Enter the number of your choice");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(k=0;k<i;k++)
{
printf(" ");
}
for(j=n;j>i;j--)
{
printf("*");
}
printf("\n");
}
}

Star Triangle Pattern in C


Star Traingle Pattern in c

Output:

 Enter the number of your choice5
     *
    * *
   * * *
  * * * *
 * * * * *

Code:

#include<stdio.h>

int main()
  {
int i,j,k, n;
printf("\n Enter the number of your choice");
scanf("%d",&n);
for(i=0;i<n;i++)                        //outer loop for each row
{
for(k=n;k>i;k--)
{
printf(" ");                   //1st inner loop for space
}
for(j=0;j<i;j++)                   //2nd inner loop for printing star
{
printf("* ");
}
printf("\n");
}
}

To select prime number from array

To select prime number from array

Code:

// display prime number from array
#include<stdio.h>

int main()
{
int arr[20];
int n,i,j;
printf("\n Enter the values in array ");
for(i=0;i<=10;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<=10;i++)
{
printf("%d",arr[i]);
}
printf("\n PRIME NUMBERS IN ARRAY ARE :---");
for(i=0;i<=10;i++)
{
int flag = 0;
for(j=2;j<arr[i];j++)
{
if(arr[i]%j == 0)
{
flag = 1;
//printf("\n %d / %d",arr[i],j);
break;
}
}
if(flag == 0)
{
printf(" %d",arr[i]);
}
}
  }

Friday 13 January 2017

Right Angle Star pattern in c

Right angle Star Pattern in C

Output:

 enter the number of your choice 5
*
**
***
****
*****
******

Code:
#include<stdio.h>

int main()
 {
int i,j,n;
printf("\n enter the number of your choice");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}

ABCDE pattern in c

Print ABCDE pattern in c

Output:

ABCDEFGHGFEDCBA
ABCDEFGGFEDCBA
ABCDEFFEDCBA
ABCDEEDCBA
ABCDDCBA
ABCCBA
ABBA
AA

Code:

#include<stdio.h>

int main()
{ int i,j,k;
char ch = 'A';
char n;
printf("\n Enter the charachter of  your choice");
scanf("%c",&n);
k = n;
for(i = ch ;i<= n; i++)
{ ch = 'A';
for(j=n; j>=i; j--)
{ printf("%c",ch);
ch++;
}
if(k==n)
{ ch--;
for(k = n-2;k>=j;k--)
{ch--;
printf("%c",ch);
}
}
else
{for(k = n-1;k>=j;k--)
{ch--;
printf("%c",ch);
}
}
printf("\n");
}
}

Hello World in C

 Hello World Program in c

Code:

#include<stdio.h>                 //preprocessor directive including header file

int main()                               //   main function called by system

{
     printf("\n Hello World);      // function to print output
     getch();                             //unformated function waiting for user input
     return 0;                         // returns value 0 if no error or return 1 if any error occurs
}

Rolls Royce

Rolls Royce
Amazing Cars

About Me