write a c program to check weather a particluar bit is set
or not?
Answer Posted / valli
#include<stdio.h>
main()
{
int n,p;
printf("enter number");
scanf("%d",&n);
printf("enter the position");
scanf("%d",&p);
if(n&(1<<p))
printf("the bit is set");
else
printf("the bit is clear");
}
| Is This Answer Correct ? | 12 Yes | 3 No |
Post New Answer View All Answers
What are the types of type qualifiers in c?
regarding pointers concept
Why enum is used in c?
What are the 5 elements of structure?
What is the use of typedef in c?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
Explain what are global variables and explain how do you declare them?
What is the difference between the local variable and global variable in c?
What is advantage of pointer in c?
What is array of pointers to string?
What are the different types of constants?
What is the use of getchar() function?
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What are the types of pointers?