Computer Science, asked by mamtakumariraj, 5 months ago

write a program to display the use of a constant.



Please give right answer

I will follow you and Mark you as brainliest

Answers

Answered by Kavyak1005
1

Explanation:

  1. #include <stdio.h>
  2. void main()
  3. {
  4. const int height = 100; /*int constant*/
  5. const float number = 3.14; /*Real constant*/
  6. const char letter = 'A'; /*char constant*/
  7. const char letter_sequence[10] = "ABC"; /*string constant*/
  8. const char backslash_char = '\?'; /*special char cnst*/
  9. printf("value of height :%d \n", height );
  10. printf("value of number : %f \n", number );
  11. printf("value of letter : %c \n", letter );
  12. printf("value of letter_sequence : %s \n", letter_sequence);
  13. printf("value of backslash_char : %c \n", backslash_char);
  14. }

Output:

value of height : 100

value of number : 3.140000

value of letter : A

value of letter_sequence : ABC

value of backslash_char : ?

Hope this Helps

Similar questions