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.

.NET FRAMEWORK in-depth

 .NET Framework Types:

The .NET Framework is available in 4 different types:

 .NET Framework: This is the general version, required to run .NET applications on Windows operating system.

 .NET Compact Framework: This is required to run .NET applications on other devices like PDA (Personal Digital Assistants), Mobile phones and Smart phones.

 .NET Micro Framework: This is very much smaller in memory size. This is designed to run .NET applications on the like Mobile phones and Smart phones having small memory capacity.

 .NET Mono Framework: This is required to run .NET applications on other operating systems like UNIX, LINUX and Solaris etc.

Components of .NET Framework

The .NET Framework is simply a collection of two components.
1. FCL (.NET Framework Class Library)
2. CLR (Common Language Runtime)



.NET (vs) Java

 
.NET (vs) Java


Microsoft’s .NET and SUN’s Java are strong competitors.

Similarities

1.Both of these support to develop console applications, windows applications, web sites, web services etc.
2.Both use their own intermediate language. Java calls it as “byte code” and .NET calls it as “MSIL”.
3.Both are Object oriented programming languages.
4.Both support Remoting.
5.Both supports multi-threading.
6.Both are platform independent.
7.Both support web related languages like Java Script, XML, CSS etc.
8.Both support the recent web development technology like AJAX.
9.Both support “Garbage collection”, which automatically clears the un-used memory.
10.Both support to develop the applications for small devices like PDA’s, mobile phones, smart phones etc.
11.Both offer better security features in their own style.




Differences


.Net is cost effective. Costs more than $700 (nearly Rs. 35,000)
Java is open source product, which can be freely downloaded on the Internet.
.Net Supports Language Independency (supports multiple languages)
Java Doesn’t offers multiple languages
.Net Offers IDE as Visual Studio by Microsoft.
Java Doesn’t offer any IDE. But other IDE’s by other vendors such as Eclipse etc.
.Net Offers easiest and fastest application development, which indirectly reduces the cost of the software.
Java Requires much time for the application development, which indirectly increases the cost of the software.
.Net Designing the UI is very much easy with “Drag and Drop” technique.
In Java UI Design requires much programmer’s effort and stress.
In .Net AJAX is implementation is much easy.
In Java AJAX is implementation is much time taking process, requires much code to write.

Advantages of .NET

 

Advantages of .NET

Supports multiple languages like VC#, VB.NET, VC++.NET, VJ#.NET etc., so that the programmer can write the code in his/her interested language.
 Offers more secured environment never before.
 Offers flexible data access with ADO.NET
 Supports to develop windows services and web services, which are necessary to handle in the live projects in the modern programming world.
 Supports to develop applications for small devices like PDA’s, smart phones, mobile phones etc.
 Offers “platform independency”, because it supports to run the .NET applications on other platforms like UNIX, LINUX and Solaris etc., with .NET Mono framework.
 Offers easier and faster UI design (with drag and drop technique), when compared with the languages like Java.
 Offers the best debugging tools in the industry, which makes the programmer to easily fix the bugs.
 Offers improved object oriented programming features like properties, sealed classes, inner classes, delegates, enumerations, collections, interfaces, generics etc.
 Offers to share and reuse the code among multiple applications very easily, with the concept of “Assemblies”.
 Offers to write queries in the programming code itself, using the newly added feature called “LINQ” (Language Integrated Query). This is newly added feature in .NET 3.5.
 Offers faster and easier Deployment features, to generate “Installer packages” for installing the .NET application on the client systems.
 Offers to create multiple threads and also to manage them for creating Multi-Threaded Applications.
 Offers XML support and interaction, which is mostly required in the modern application development environment.
 Supports to create user defined graphics like lines, rectangles, bars, circles etc., very easily using “GDI+” (Graphics Device Interface) concepts.
 Offers a new and attractive feature called WPF (Windows Presentation Foundation), which is built on DirectX and which enables the programmer to create 2-D and 3-D graphics, animation, games, audio and view players etc. This is newly added feature in .NET 3.5.
 Offers another prestigious feature called WCF (Windows Communication Foundation), which integrates the network programming related libraries of .NET like .NET Remoting, SOAP enabled web services and message queues etc., which helps the programmer to develop service and network oriented applications using .NET. This is newly added feature in .NET 3.5.
 Support for the most recent web technology called AJAX (Asynchronous JavaScript and XML) along with ASP.NET. As a result of AJAX, the developer can produce newer generation user experiences on the web. Ex: www.orkut.com.

.NET (vs) Java

Microsoft’s .NET and SUN’s Java are strong competitors.
Similarities
1.Both of these support to develop console applications, windows applications, web sites, web services etc.
2.Both use their own intermediate language. Java calls it as “byte code” and .NET calls it as “MSIL”.
3.Both are Object oriented programming languages.
4.Both support Remoting.
5.Both supports multi-threading.
6.Both are platform independent.
7.Both support web related languages like Java Script, XML, CSS etc.
8.Both support the recent web development technology like AJAX.
9.Both support “Garbage collection”, which automatically clears the un-used memory.
10.Both support to develop the applications for small devices like PDA’s, mobile phones, smart phones etc.
11.Both offer better security features in their own style.

Differences

.Net is cost effective. Costs more than $700 (nearly Rs. 35,000)
Java is open source product, which can be freely downloaded on the Internet.
.Net Supports Language Independency (supports multiple languages)
Java Doesn’t offers multiple languages
.Net Offers IDE as Visual Studio by Microsoft.
Java Doesn’t offer any IDE. But other IDE’s by other vendors such as Eclipse etc.
.Net Offers easiest and fastest application development, which indirectly reduces the cost of the software.
Java Requires much time for the application development, which indirectly increases the cost of the software.
.Net Designing the UI is very much easy with “Drag and Drop” technique.
In Java UI Design requires much programmer’s effort and stress.
In .Net AJAX is implementation is much easy.
In Java AJAX is implementation is much time taking process, requires much code to write.

.NET FRAMEWORK in-depth

.NET Framework Types:
The .NET Framework is available in 4 different types:
 .NET Framework: This is the general version, required to run .NET applications on Windows operating system.
 .NET Compact Framework: This is required to run .NET applications on other devices like PDA (Personal Digital Assistants), Mobile phones and Smart phones.
 .NET Micro Framework: This is very much smaller in memory size. This is designed to run .NET applications on the like Mobile phones and Smart phones having small memory capacity.
 .NET Mono Framework: This is required to run .NET applications on other operating systems like UNIX, LINUX and Solaris etc.

Components of .NET Framework

The .NET Framework is simply a collection of two components.
1. FCL (.NET Framework Class Library)
2. CLR (Common Language Runtime)