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

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

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

Result

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

Leave a Comment