



{"id":583,"date":"2016-08-16T12:54:28","date_gmt":"2016-08-16T12:54:28","guid":{"rendered":"http:\/\/localhost\/computersirkiclass\/?p=583"},"modified":"2016-08-16T12:54:28","modified_gmt":"2016-08-16T12:54:28","slug":"display-ascii-code","status":"publish","type":"post","link":"https:\/\/computersirkiclass.com\/cskc\/display-ascii-code\/","title":{"rendered":"Display ASCII Code"},"content":{"rendered":"<div id=\"modal-ready\"><div class=\"boxed\">\n<div id=\"main\">\n<div id=\"content\">\n<div id=\"Title\">\n<div id=\"TitleLeft\">#Code Learning Sheet# JV1020-0<\/div>\n<div id=\"TitleRight\">(Language: Java)<\/div>\n<div>\n<hr \/>\n<\/div>\n<\/div>\n<div id=\"TopContent\">\n<div id=\"TopContentLeft\">\n<div><span id=\"CodeName\">Display ASCII Code<\/span><br \/>\n<span id=\"CodeDesc\">This is a program that will tell you about the process used to find out the ASCII values of characters in java<\/span><\/div>\n<div>\n<h2>Learning Objectives:<\/h2>\n<p>To learn java concepts related to :<\/p>\n<ul>\n<li>ASCII code.<\/li>\n<li>Implicit conversion.<\/li>\n<li>Explicit conversion.<\/li>\n<\/ul>\n<\/div>\n<div class=\"half_linespace \"><\/div>\n<div>\n<h2>Program Objective:<\/h2>\n<p>The objective is to demonstrate the process of finding the ASCII code of a particular character. This is done in two ways:- Implicit conversion and Explicit conversion.The implicit conversion is performed by the compiler itself and explicit conversion is the forced conversion performed by the user.<\/p>\n<\/div>\n<div>\n<h2>Approach\/Algorithm:<\/h2>\n<p>We will be initializing a character value to a variable. Then we would be first converting it integer type to find its ASCII value by implicit conversion method and then by explicit conversion method.<\/p>\n<\/div>\n<div>\n<h2>Source Code:<\/h2>\n<p><b>Suggested Filename:<\/b>ASCIICode.java<\/p>\n<\/div>\n<\/div>\n<div id=\"TopContentRight\"><br \/>\n<\/div>\n<\/div>\n<div id=\"BottomContent\">\n<pre class=\"blockcode\"><code><span class=\"line\">class ASCIICode<\/span>\n<span class=\"line\">{<\/span>\n<span class=\"line\">    public static void main(String[] args) <\/span>\n<span class=\"line\">    {<\/span>\n<span class=\"line\">        char c='a';<\/span>\n<span class=\"line\">        int n=(int)c;  \/\/explicit casting of character to integer<\/span>\n<span class=\"line\">        int n1=c; \/\/implicit conversion of character to integer<\/span>\n<span class=\"line\">        System.out.println(\"The explicit converted code is :\"+n);<\/span>\n<span class=\"line\">        System.out.println(\"The implicit converted code is :\"+n);<\/span>\n<span class=\"line\">    }<\/span>\n<span class=\"line\">}<\/span><\/code>\n<\/pre>\n<div style=\"float: right; margin-top: 5px;\"><style type=\"text\/css\">#AnythingPopup_BoxContainer3\t{width:350px;height:300px;max-width:80%;background:#FFFFFF;border:1px solid #043E4D;padding:0;position:fixed;z-index:99999;cursor:default;-moz-border-radius: 10px;-webkit-border-radius: 10px;-khtml-border-radius: 10px;border-radius: 10px;   display:none;} #AnythingPopup_BoxContainerHeader3 {height:30px;background:#05A2D1;border-top-right-radius:10px;-moz-border-radius-topright:10px;-webkit-border-top-right-radius:10px;-khtml-border-top-right-radius: 10px;border-top-left-radius:10px;-moz-border-radius-topleft:10px;-webkit-border-top-left-radius:10px;-khtml-border-top-left-radius: 10px;} #AnythingPopup_BoxContainerHeader3 a {color:#FFFFFF;font-family:Verdana,Arial;font-size:10pt;font-weight:bold;} #AnythingPopup_BoxTitle3 {float:left; margin:5px;color:#FFFFFF;font-family:Verdana,Arial;font-size:12pt;font-weight:bold;} #AnythingPopup_BoxClose3 {float:right;width:50px;margin:5px;} #AnythingPopup_BoxContainerBody3 {margin:10px;overflow:auto;height:240px;} #AnythingPopup_BoxContainerFooter3 {position: fixed;top:0;left:0;bottom:0;right:0;opacity: .3;-moz-opacity: .3;filter: alpha(opacity=30);z-index:999;display:none;} <\/style><a href='javascript:AnythingPopup_OpenForm(\"AnythingPopup_BoxContainer3\",\"AnythingPopup_BoxContainerBody3\",\"AnythingPopup_BoxContainerFooter3\",\"350\",\"300\");'>Test it !<\/a><div style=\"display: none;\" id=\"AnythingPopup_BoxContainer3\"><div id=\"AnythingPopup_BoxContainerHeader3\"><div id=\"AnythingPopup_BoxTitle3\">Test CPP Code !<\/div><div id=\"AnythingPopup_BoxClose3\"><a href=\"javascript:AnythingPopup_HideForm('AnythingPopup_BoxContainer3','AnythingPopup_BoxContainerFooter3');\">Close<\/a><\/div><\/div><div id=\"AnythingPopup_BoxContainerBody3\">The code has been copied automatically for you in the clipboard. After that open any of the service and press cntrl-v to paste in the given code area. Needs a bit of tweaking as per the link.\r<br \/>\r<br \/>&nbsp;\r<br \/>\r<br \/>&nbsp;\r<br \/><ul>\r<br \/> \t<li style=\"list-style-type: none\">\r<br \/><ul>\r<br \/> \t<li><a href=\"http:\/\/cpp.sh\/\" target=\"blank\">cpp.sh CPP<\/a><\/li>\r<br \/> \t<li><a href=\"https:\/\/www.programiz.com\/cpp-programming\/online-compiler\/\" target=\"blank\">Programiz<\/a><\/li>\r<br \/> \t<li><a href=\"https:\/\/www.onlinegdb.com\/online_c++_compiler\" target=\"blank\">Onlinegdb<\/a><\/li>\r<br \/> \t<li><a href=\"https:\/\/www.codechef.com\/cpp-online-compiler\" target=\"blank\">Codechef<\/a><\/li>\r<br \/><\/ul>\r<br \/><\/li>\r<br \/><\/ul>\r<br \/>&nbsp;<\/div><\/div><div style=\"display: none;\" id=\"AnythingPopup_BoxContainerFooter3\"><\/div><\/div>\n<div id=\"UnderstandingProgram\">\n<h2>Output&#8230;<\/h2>\n<p class=\"output\">The explicit converted code is :97<br \/>\nThe implicit converted code is :97<\/p>\n<h2>Understanding Program:<\/h2>\n<p class=\"output\">int n=(int)c;<\/p>\n<p>Here, we have explicitly converted the character c into integer for finding its ASCII value. This is the forced conversion by the user .<\/p>\n<p class=\"output\">int n1=c;<\/p>\n<p>Here, we have implicitly converted the character c into an integer for its ASCII value, this is not a forced conversion . The compiler automatically converts the data types.<\/p>\n<\/div>\n<\/div>\n<div id=\"DummyDiv\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p> This program demonstrates Implicit and explicit conversion of data types in a java program.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[],"model_paper":[],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-java-11-12"],"acf":[],"_links":{"self":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":0,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"wp:attachment":[{"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/tags?post=583"},{"taxonomy":"model_paper","embeddable":true,"href":"https:\/\/computersirkiclass.com\/cskc\/wp-json\/wp\/v2\/model_paper?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}