Posts

Showing posts from August, 2022

C programming

  // WK1_2 : pgm to illustrate the use of different data types and verify their memory size #include<stdio.h> #include<conio.h> void main() {  int a,b,c,d,e,f;  clrscr();  printf("the primitive data types used in C are as shown below\n");  printf("-------------------------------------------------------");  printf("\nData type \t\t\t Size (in Bytes)\n");  printf(" ------------------------------------------------------");  a=sizeof(int);  b=sizeof(float);  c=sizeof(char);  d=sizeof(double);  e=sizeof(short int);  f=sizeof(long int);  printf("\nint \t\t\t\t %d",a);  printf("\nfloat \t\t\t\t %d",b);  printf("\nchar \t\t\t\t %d",c);  printf("\ndouble \t\t\t\t %d",d);  printf("\nshort int \t\t\t %d",e);  printf("\nlong int \t\t\t %d",f);  getch(); } Output: //WK2_1A: PGM TO compute SI , given P,T,R #include<stdio.h> #include<conio.h> void main() {  float P,T,R...