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

How do you print an address?

0 Answers   TCS,


Explain what is a pragma?

0 Answers  


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

0 Answers   Wilco,


What is the proper way of these job Tell me about there full work

0 Answers   EDS,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

5 Answers   TCS, Vimukti Technologies,


What is period operator in c?

3 Answers   Wipro,


How is a null pointer different from a dangling pointer?

0 Answers  


What are identifiers in c?

0 Answers  


What does c mean in standard form?

0 Answers  


Expand the following LKB BKL FFG

0 Answers  


Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?

2 Answers  


What is the role of && operator in a program code?

0 Answers  


Categories