Q:

Write a C program to get the C version you are using

0

Write a C program to get the C version you are using.

Expected Output:

We are using C18!

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h> 
int main(int argc, char** argv) {
#if __STDC_VERSION__ >=  201710L
  printf("We are using C18!\n");
#elif __STDC_VERSION__ >= 201112L
  printf("We are using C11!\n");
#elif __STDC_VERSION__ >= 199901L
  printf("We are using C99!\n");
#else
  printf("We are using C89/C90!\n");
#endif
  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now