Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Answer / Ankita Bansal
Yes, you can use base-2 constants in C by prefixing them with `0b`. Here's an example of declaring and using a base-2 constant:nn```cn#include <stdio.h>nnint main() {n unsigned int myNumber = 0b101010;n printf("myNumber in decimal: %d
", myNumber);nreturn 0;n}n``` Unfortunately, there is no direct `printf` format for binary output. To print a value in binary, you can convert the number to binary strings and then print each bit individually.
| Is This Answer Correct ? | 0 Yes | 0 No |
how to generate the length of a string without using len funtion?
write a c/c++ programthat connects to a MYSQL server and checks if the INNoDB plug in is installed on it.If so your program should print the total number of disk writes by MYSQL.
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.
#include<stdio.h> int main( ) { Int a=300, b, c; if(a>=400) b=300; c=200; printf(“%d%d ”, b, c); return0; }
In a switch statement, explain what will happen if a break statement is omitted?
Are the expressions * ptr ++ and ++ * ptr same?
How can you restore a redirected standard stream?
explain memory layout of a C program
Write a programm such that if user enter 11.25 it roundup to 11 but if user enter 11.51 upto 11.99 it will round up to 12 i.e.;convert the floting point value into integer format as explain above..
prog for 1st five prime numbers in 2^x - 1
how to generate sparse matrix in c