What are the different types of constants?



What are the different types of constants?..

Answer / Mayank Agarwal

In C, there are two main types of constants: integer constants (like 123) and floating-point constants (like 12.5). Additionally, C supports character constants (enclosed in single quotes, like 'a'), string literals (enclosed in double quotes, like "hello"), and enumerated constants (defined with the enum keyword).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How #define works?

1 Answers  


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

1 Answers  


What are global variables?

1 Answers  


Write a program to generate prime factors of a given integer?

9 Answers   Microsoft,


What is the size of empty structure in c?

1 Answers  


Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

4 Answers  


What is a newline escape sequence?

1 Answers  


How do you sort filenames in a directory?

1 Answers  


When is the “void” keyword used in a function?

2 Answers  


difference between string and array?

6 Answers  


Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;

18 Answers   Accenture, Cisco, Egentec, HCL, Ideaz, Infosys, M-Systems, MYR, TCS,


write a program to find lcm and hcf of two numbers??

1 Answers  


Categories