Skip to main content

Posts

PL/SQL Program for Armstrong Number

Here you will get pl/sql program for armstrong number. A number is said to be an armstrong number if sum of its digits raised to the power n is equal to number itself, where n is total digits in number. For example 407 is armstrong number as 4 3  + 0 3 + 7 3  = 64 + 0 + 343 = 407. PL/SQL Program for Armstrong Number declare n number:=407; s number:=0; r number; len number; m number; begin m:=n; len:=length(to_char(n)); while n>0 loop r:=mod(n,10); s:=s+power(r,len); n:=trunc(n/10); end loop; if m=s then dbms_output.put_line('armstrong number'); else dbms_output.put_line('not armstrong number'); end if; end; / Output armstrong number The post PL/SQL Program for Armstrong Number appeared first on The Crazy Programmer . from The Crazy Programmer http://www.thecrazyprogrammer.com/2017/08/plsql-program-armstrong-number.html

PL/SQL Program to Swap two Numbers

Here you will get pl/sql program to swap two numbers with and without using temporary variable. Method 1: Using Temporary Variable declare a number; b number; temp number; begin a:=5; b:=10; dbms_output.put_line('before swapping:'); dbms_output.put_line('a='||a||' b='||b); temp:=a; a:=b; b:=temp; dbms_output.put_line('after swapping:'); dbms_output.put_line('a='||a||' b='||b); end; / Output before swapping: a=5 b=10 after swapping: a=10 b=5 Method 2: Without Using Temporary Variable declare a number; b number; begin a:=5; b:=10; dbms_output.put_line('before swapping:'); dbms_output.put_line('a='||a||' b='||b); a:=a+b; b:=a-b; a:=a-b; dbms_output.put_line('after swapping:'); dbms_output.put_line('a='||a||' b='||b); end; / The post PL/SQL Program to ...

Pl/SQL Program for Palindrome Number

Here you will get pl/sql program for palindrome number. A number is called palindrome number if its reverse is equal to itself. For example 12321 is palindrome while 123 is not palindrome. Pl/SQL Program for Palindrome Number declare n number; m number; i number; rev number:=0; r number; begin n:=12321; m:=n; while n>0 loop r:=mod(n,10); rev:=(rev*10)+r; n:=trunc(n/10); end loop; if m=rev then dbms_output.put_line('number is palindrome'); else dbms_output.put_line('number is not palindrome'); end if; end; / Output number is palindrome Comment below if you have any queries regarding above palindrome program in pl sql. The post Pl/SQL Program for Palindrome Number appeared first on The Crazy Programmer . from The Crazy Programmer http://www.thecrazyprogrammer.com/2017/08/plsql-program-palindrome-number.html

C++ STL Map Container – std::map

In this tutorial you will learn about STL Map container in C++ i.e., std::map and all functions applicable on it. Map is an associative container. Map satisfies the word “associative”. That means every value in map is associated with a key. All keys are unique. No two mapped values can have same key. The type of key and stored values may differ. All elements follow a strict order. When we insert element automatically stored in its correct position. C++ STL Map Iterators that can be applicable on map: begin(): returns iterator to the beginning. end(): returns iterator to the end of the map. rbegin(): returns reverse iterator to reverse beginning. rend(): returns reverse iterator to reverse end. cbegin(): Returns constant iterator to the beginning. cend(): Returns constant iterator to the end. These iterators we can use in our programs. First thing we need to include map header file. Which is #include<map> Let see some functions associated with map: Inserting ele...

Experimental: Reducing the size of .NET Core applications with Mono's Linker

The .NET team has built a linker to reduce the size of .NET Core applications. It is built on top of the excellent and battle-tested mono linker . The Xamarin tools also use this linker so it makes sense to try it out and perhaps use it everywhere! "In trivial cases, the linker can reduce the size of applications by 50%. The size wins may be more favorable or more moderate for larger applications. The linker removes code in your application and dependent libraries that are not reached by any code paths. It is effectively an application-specific dead code analysis ." - Using the .NET IL Linker I recently updated a 15 year old .NET 1.1 application to cross-platform .NET Core 2.0 so I thought I'd try this experimental linker on it and see the results. The linker is a tool one can use to only ship the minimal possible IL code and metadata that a set of programs might require to run as opposed to the full libraries. It is used by the various Xamarin products to extract...

C++ STL Set Container – std::set

In this tutorial you will learn about STL Set container in C++ i.e. std::set and all functions applicable on it. Set is a associative container. We know that in associative containers each element is unique. So sets are also containers that stores unique elements following in a specific order. The word associative means each value associated with a key value. For any kind of operation key will be more preferred than actual value. Here sets are special type of associative containers where value itself is key value. Some more facts about set are, elements in set are constant. It means that we are unable to modify once we insert the element. If we want to update element then we should delete that element and again insert with updated element. The elements in the set are always sorted. C++ STL Set Let see some functions associated with sets: Before working with functions let see iterators that can apply on list to manipulate the data in list. begin(): returns iterator to the beginni...

Difference between HTML and HTML5

In this article you will learn about difference between HTML and HTML5. Introduction to Markup Languages The term markup language may not ring the bell for an individual who has never been a part of the web designing universe but for the professionals, it is no less than the gravitational force that keeps the world wide web organized and accessible. The markup languages are basically used to process, embed, manage and manipulate text in style files and tags by making them easier for computers to understand and control. The markup languages laid the foundation of World Wide Web years ago and all that you see in organized format is due to the perfect combination of design (CSS), text (markup) and their interaction with the help of front end scripts. HTML HTML (Hyper Text Markup Language) was the first out and out markup language for web development purposes and all the web pages that we see in an organized and interactive format with engaging multi media, styled texts, and many more ...