Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need some help on writng a code using C. sumahsan@yahoo.com

Status
Not open for further replies.

safu

Technical User
Feb 7, 2000
1
US
<br>

<br>

I am just learning the C language and I am having some problem on writng a code.. I am trying to write a code that would show the Ascii character and its corrosponding value <br>

<br>

like :<br>

<br>

Ascii Value Letter<br>

<br>

65 A 66 B 67 C<br>

......... Z<br>

97 a 98 a .....<br>

.............. z<br>

0 1 .......<br>

<br>

can someone please help me on this one
 
#include &lt;stdio.h&gt;<br>
<br>
<br>
main()<br>
{<br>
int x = 89;<br>
char s;<br>
<br>
s = x;<br>
<br>
printf(&quot;%c&quot;, s);<br>
}<br>
<br>
<br>
Output<br>
Y<br>
<br>
Here is an example of an sample program that takes a integer value and shows its ascii value which is uppercase Y.If you put this in a for loop you can see all the ascii characters. You have to start of with either a character the convert it to an int to get its integer value. hope this helps<br>
<br>
tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top