if we take a number as a char then can we manipulate(add,
subtract) on this number
Answer Posted / aravind
yes.For example
#include<stdio.h>
int main()
{
int x,y;
x='A'+1;
y='B'-1;
printf("%d,%d\n",x,y);
}
It will add the Asci value of A and subtracts B, Than 62 or B will be ans for x and A or 61 will be ans for y.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What are the various types of control structures in programming?
main() { printf("hello"); fork(); }
Explain how can I remove the trailing spaces from a string?
hi send me sample aptitude papers of cts?
How can I change their mode to binary?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
Can stdout be forced to print somewhere other than the screen?
Explain what are the standard predefined macros?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
How do you write a program which produces its own source code as output?
Do pointers need to be initialized?
What is int main () in c?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
With the help of using classes, write a program to add two numbers.
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }