Sum Of Even Numbers DoWhile Loop

  Sum Of Even Numbers DoWhile Loop 


import java.util.Scanner;


public class Demo {


public static void main(String[] args) {

int x=1,n,sum=0;

Scanner s=new Scanner(System.in);

System.out.println("Enter n value");

n=s.nextInt();

do

{

if(x%2==0)

{

sum=sum+x;

}

x++;

}while(x<=n);

System.out.println(sum);

}



}


Output:

Enter n value

5

6


Sum Of Natural Numbers DoWhile Loop

 

  • Sum Of Natural Numbers DoWhile Loop

import java.util.Scanner;


public class Demo {


public static void main(String[] args) {

int x=1,n,sum=0;

Scanner s=new Scanner(System.in);

System.out.println("Enter n value");

n=s.nextInt();

do

{

sum=sum+x;

x++;

}while(x<=n);

System.out.println(sum);

}



}



output:

Enter n value

5

15

Factorial Number Using DoWhile Loop -up to n Numbers

  

  • Factorial Number Using DoWhile Loop(up to n Numbers)

import java.util.Scanner;


public class Demo {


public static void main(String[] args) {

int x=1,n,fact=1;

Scanner s=new Scanner(System.in);

System.out.println("Enter n value");

n=s.nextInt();

do

{

fact=fact*x;

System.out.println(x+" Factorial =" +fact);

x++;

}while(x<=n);

}



}


Output:

Enter n value

5

1 Factorial =1

2 Factorial =2

3 Factorial =6

4 Factorial =24

5 Factorial =120

More Programs visit : http://sateeshm.com/

Factorial Number Using DoWhile Loop

 

  • Factorial Number Using DoWhile Loop

import java.util.Scanner;


public class Demo {


public static void main(String[] args) {

int x=1,n,fact=1;

Scanner s=new Scanner(System.in);

System.out.println("Enter n value");

n=s.nextInt();

do

{

fact=fact*x;

x++;

}while(x<=n);

System.out.println(fact);

}



}


Output:

Enter n value

5

120

More Programs visit : http://sateeshm.com/

Display Even Number or Odd Number Based On The N Value Using DoWhile Loop using Single Loop

  

  • Display Even Number or Odd Number Based On The N Value Using DoWhile Loop using Single Loop


import java.util.Scanner;


public class Demo {


public static void main(String[] args) {

int x=1,n;

Scanner s=new Scanner(System.in);

System.out.println("Enter n value");

n=s.nextInt();

do

{

if(x%2==0 && n%2==0)

{

System.out.println(x);

}

else if(x%2==0 && n%2==0)

{

System.out.println(x);

}

x++;

}while(x<=n);

}



}




output:

Enter n value

10

2

4

6

8

10


Enter n value

11

1

3

5

7

9

11


More information visit:http://sateeshm.com/

Display Even Number or Odd Number Based On The N Value Using DoWhile Loop

 

  • Display Even Number or Odd Number Based On The N Value Using DoWhile Loop


import java.util.Scanner;


public class Demo {


public static void main(String[] args) {

int x=1,n;

Scanner s=new Scanner(System.in);

System.out.println("Enter n value");

n=s.nextInt();

if(n%2==0)

{

do

{

if(x%2==0)

{

System.out.println(x);

}

x++;

}while(x<=n);

}

else

{

do

{

if(x%2!=0)

{

System.out.println(x);

}

x++;

}while(x<=n);

}



}


}


output:

Enter n value

10

2

4

6

8

10


Enter n value

11

1

3

5

7

9

11


More information visit:http://sateeshm.com/

An Introduction to .NET Framework



An Introduction to .NET Framework




 The .NET Framework is a Microsoft's development platform.
 It offers to develop software applications.
 It was released by Microsoft Corporation in 2002. Later on several improvements take place in .NET Framework, which makes it as much strong, advanced and more efficient platform for building different kinds of software applications.
 Why it is called as “platform” is, it acts as platform for multiple languages, tools and libraries.
 It offers visually stunning user experiences, which is mostly required today’s competitive programming world.
 It offers much advanced security features never before.
 Supports dozens of languages like C#, VB.NET, VC++.NET, COBOL, Pascal, Python etc.

Features of .NET Framework

 Next Generation User Experiences:

.NET offers a Framework for building applications and high-fidelity experiences in Windows that blend together application UI, documents, and media content, while exploiting the full power of the computer. WPF (Windows Presentation Foundation) offers developers support for 2D and 3D graphics, hardware accelerated effects, scalability to different form factors, interactive data visualization, and superior content readability.

 Seamless and Secured Environment:

Application security is a big deal these days; perhaps the most closely examined feature of any new application. .NET offers its best secured environment at run time. So that it is highly impossible to access the .NET application and its related data by the un-authorized users / hackers.
The assembly (the compiled code of .NET framework) contains the security information like which categories of users or who can access the class or method. So that we can say that .NET Framework applications are much secured.
The security can be improved in the ASP.NET Web Sites by Security models like Integrated Windows Authentication, Microsoft Passport Authentication, Forms Authentication, and Client Certificate authentication.

 Multi Language Support:

.NET provides a multi-language development platform, so you can work in the programming language you prefer. The Common Language Runtime (A part of .NET Framework) provides support for 3 Microsoft developed languages and several other languages from other vendors.
Languages Supported by .NET Framework

Languages from Microsoft

Visual C#.NET
Visual Basic.NET
Visual C++.NET
Languages from other vendors

APL,
Cobol,
Perl,
Pascal,
Component Pascal,
Curriculum,
Eiffel,
Forth,
Fortran,
Haskell,
J#,
Mercury,
Mondrian,
Oberon,
Python,
IronPython,
RPG,
Scheme,
Small Talk,
Standard ML

 Flexible Data Access:
.NET Framework supports flexible accessibility of database data with ADO.NET (ActiveX Data Objects .NET). ADO.NET is a set of classes that expose data access services to the .NET programmer. ADO.NET provides a rich set of components for creating distributed, data-sharing applications. It is an integral part of the .NET Framework, providing access to relational, XML, and application data.

Modules of .NET

1. C#.NET (C Sharp.NET) –(Language)
 It is highly used .NET programming language, used by most of the .NET programmers.
 It borrows some programming features from “C” and some other programming features from “C++”. In addition to these, it borrows few of the good features of java language.
 It is the object oriented programming language.
2. VB.NET (Visual Basic.NET) –(Language)
 It is the Microsoft’s recommended language for beginners of windows programming.
 But in fact, it is used in very few of the projects in the real-time development world, because most of the programmers usually comes with “C” and “C++” background; hence they feel comfortable with “C#”.
 It borrows some programming features from VB (Visual Basic) language.
 It is the object oriented programming language.
3. ASP.NET (Active Server Pages.NET) – (Web Technology)
 It is the Microsoft’s web technology.
 It is used for web sites development.
 It offers much attractive and user friendly user interfaces in the server side applications.
 It is the new version to another Microsoft’s technology called ASP (Active Server Pages), which is a famous web technology before introducing ASP.NET.
 It requires HTML for web page designing.
 It requires a .NET language (like C#, VB.NET, VC++.NET etc.) for server side logic implementation.
4. ADO.NET (ActiveX Data Objects.NET) – (Database Technology)
It is the Microsoft’s database technology.
 It offers necessary programming libraries to access the local / server databases.
 It is the new version to another Microsoft’s technology called ADO (ActiveX Data Objects), which is a famous database technology, used with VB, VC++ and ASP languages.
 It requires a .NET language (like C#, VB.NET, VC++.NET etc.) for logic implementation.