Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


if we take a number as a char then can we manipulate(add,
subtract) on this number

Answers were Sorted based on User's Feedback



if we take a number as a char then can we manipulate(add, subtract) on this number..

Answer / 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

if we take a number as a char then can we manipulate(add, subtract) on this number..

Answer / deepak garg

#include<stdio.h>
int main()
{
int x,y;
x=1+'a';
y='b'-1;
printf("%d,%d\n",x,y);
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

who is the founder of c

19 Answers   College School Exams Tests, HP,


Write the test cases for checking a variable having value in range -10.0 to +10.0?

0 Answers   Bosch,


What is typeof in c?

0 Answers  


what value is returned to operating system after program execution?

0 Answers  


Can you tell me how to check whether a linked list is circular?

1 Answers  


i want to asked a question about c program the question is: create a c program that displays all prime numbers less than 500? using looping statement

5 Answers  


Juxtapose the use of override with new. What is shadowing?

1 Answers  


What are all different types of pointers in c?

0 Answers  


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

0 Answers  


write a program whose output will be- 1 12 123 1234

10 Answers  


Can you please explain the difference between exit() and _exit() function?

0 Answers  


How do I access command-line arguments?

2 Answers   Bosch, Wipro,


Categories