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...


how to set Nth bit of a variable?



how to set Nth bit of a variable?..

Answer / kirankumaryakkala

ex: int res=16, temp=1,n;
printf("enter the Nth bit no");
scanf("%d",&n);
temp=temp<<n; //leftshift to ntimes
res=res|temp; //bitwise OR
printf("setted nth bit of res %d",res);

Is This Answer Correct ?    9 Yes 4 No

Post New Answer

More C Interview Questions

How can you find out how much memory is available?

0 Answers  


What are the benefits of organizational structure?

0 Answers  


What is identifiers in c with examples?

0 Answers  


what are the compilation steps? ( i want inside the compiler )

2 Answers  


what type of language is C?

13 Answers   Microsoft,


What is the benefit of using const for declaring constants?

0 Answers  


Where are some collections of useful code fragments and examples?

0 Answers   Celstream,


What is key word in c language?

4 Answers   ABC,


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

0 Answers  


how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.

2 Answers  


write a C program, given number is double without using addt ion and multiplication operator?ex:n=6,ans=12,pls send me ans to goviseenu@gmail.com

6 Answers  


what is the need for main function in c?

5 Answers  


Categories