Skip to content

Tag Archives: C-Data Types

In C, sizes of an integer and a pointer must be same. (A) True (B) False Answer: (B) Explanation: Sizes of integer and pointer are… Read More
Predict the output of following C program #include <stdio.h> int main() {     char a = 012;        printf("%d", a);        return 0; } (A) Compiler… Read More
Which of the following is not a valid declaration in C? 1. short int x; 2. signed short x; 3. short x; 4. unsigned short… Read More
Predict the output of following program. Assume that the numbers are stored in 2’s complement form. #include<stdio.h>  int  main()  {     unsigned int x = -1; … Read More
Prerequisite: Bool Data Type in C++The C99 standard for C language supports bool variables. Unlike C++, where no header file is needed to use bool,… Read More
Solution: Use sprintf() function. #include<stdio.h> int main() {     char result[50];     float num = 23.34;     sprintf(result, "%f", num);     printf("\n The string for the num is %s",… Read More
Algorithm: roundNo(num) 1. If num is positive then add 0.5. 2. Else subtract 0.5. 3. Type cast the result to int and return. Example: num… Read More

Start Your Coding Journey Now!