i use vim and we have to create this basically creating is as a subroutine
Code:
/*
2 File: Lab3-5.c
3 Course:
4 Author:
5 Date: Monday January 23, 2006
6 */
7
8 #include <stdio.h>
9 void datatypes()
10 {
11
12
13
14
15 fprintf(stdout, "Type float on Munro has a size of %u bytes \n",sizeof(float));
16 fprintf(stdout, "Type double on Munro has a size of %u bytes.\n",sizeof(double));
17 fprintf(stdout, "Type long double on Munro has a size of %u bytes.\n",sizeof(long double));
18 fprintf(stdout, "Type short on Munro has a size of %u bytes.\n",sizeof(short));
19 fprintf(stdout, "Type long on Munro has a size of %u bytes.\n",sizeof(long));
20
21 int main()
22 {
23 datatypes();
24 return 0;
24 }
I got it to show up thw size of each one there with %u and sizeof right but i dont know how the convert each one of them to bits and nibbles in code. anyone can do it on paper but its the code i tried using other things like int bit and nibble and multiple it out but i dont know how to get it to print the output. .. anyhelp wud be appreciated..