/*
This is the second lab of Lab EE107
The purpose of this lab is to understand the variable and the printf
datatypes
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Jan 23, 2024.
*/
/* display the basic types variables of C */
#include <stdio.h>
int main(void) {
int interVar_EEU = 100;
float floatingvar_EEU = 331.79;
double doubleVar_EEU = 8.44e+11;
char charVar_EEU = 'W';
_Bool booVar_EEU = 0;
//printing out the basic types with % assigned the variables
printf ("interVar = %i\n",interVar_EEU);//%i for integer
printf("floatingvar = %f\n", floatingvar_EEU);//%f for float
printf("doubleVar = %e\n",doubleVar_EEU);// for the exponential place value
printf("doubleVar = %g\n",doubleVar_EEU);//for the significant figures
printf("charvar = %c\n",charVar_EEU);//for string
printf("booVar = %i\n",booVar_EEU);// for bool with only intergers "0" or "1".
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: