0% found this document useful (0 votes)
34 views

C Class1

The document contains C code snippets that demonstrate basic data types like char, int, and int8_t and their sizes. It also shows how to read input using scanf and print output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

C Class1

The document contains C code snippets that demonstrate basic data types like char, int, and int8_t and their sizes. It also shows how to read input using scanf and print output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <stdio.

h>
#include <stdint.h>
int main ( )
{
printf("int8_t = %lu \n", sizeof(int8_t) );
printf("int16_t = %lu \n", sizeof(int16_t) );
printf("int32_t = %lu \n", sizeof(int32_t) );
printf("int64_t_t = %lu \n", sizeof(int64_t) );
return 0;
}

#include <stdio.h>

int main ( )
{
printf("Sizeof char = %lu \n", sizeof(char) );
printf("Sizeof short = %lu \n", sizeof(short int) );
printf("Sizeof int = %lu \n", sizeof(int) );

return 0;
}

#include <stdio.h>
#include <stdint.h>
int main ( )
{
int32_t a;

printf("Enter a number : ");


scanf(" %d" , &a );

printf("a = %d \n", a);


return 0;
}

char s[100];
char c;

scanf("%[^\n]", &s);
c=getchar();

/* Enter your code here. Read input from STDIN. Print output to

printf("Hello, World!\n%s", s);

return 0;

You might also like