program to find the ASCII value of a number

Answer Posted / thiyanesh

#include<stdio.h>
void main()
{
char num ;
printf("enter the number: ");
scanf("%c",&num);
printf("the ascii value of %c is %d",num,num);
return 0;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why clrscr is used after variable declaration?

1339


what is ur strangth & weekness

2052


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

896


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

881


What is difference between arrays and pointers?

793


Describe the modifier in c?

892


Which function in C can be used to append a string to another string?

937


Is it possible to execute code even after the program exits the main() function?

1100


what do the 'c' and 'v' in argc and argv stand for?

900


What are the application of void data type in c?

988


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2263


What are the different categories of functions in c?

896


Can a pointer be static?

843


What is the difference between int main and void main?

814


What is data types?

847