Skip to content
  • Logout
  • Upgrade
  • Register
  • Profile
  • Login
  • Home
Anoop's Blogs

Anoop's Blogs

My Potpourri of Blogs

  • Home
  • About
  • Internet of Things
    • Arduino
    • Raspberry Pi
  • Programming
    • C Programming
    • Python Programming
      • Python … continued
    • R Programming
  • Cooking
  • Health
  • Photos
    • Birds
      • Birds – Bullock’s Oriole
    • Birds in Doyle Park – San Diego – Set 1
    • Birds in Doyle Park – Set 2
    • Birds in Doyle Park – Set 3
    • India – Fall 2019
      • Vashi
      • Puri
      • Bhubaneshwar
      • Konark
      • Chilika Lake
      • Mysore
      • Somnathpur
      • Ranganathittu Bird Sanctuary
  • Hindi Poems
    • Kavi Ki Duvidha
  • Spiritual
  • Sandhyopasana
    • Sandhya-Havan Books
  • Music
    • Hindi Film Songs
    • Playlist #1
    • Songs of Shamshad Begum
    • Songs Playlist A1
  • Toggle search form

C Programming

Notes from C Programming for Arduino

#include <stdio.h>
int main() {
/* my first program in C */
printf(“Hello, World! \n”);
return 0;
}

$ gcc -v

$ gcc hello.c
$ ./a.out
Hello, World!

 

$ gcc -v

$ gcc hello.c
$ ./a.out
Hello, World!

Data Types

Integer: char (1 byte), unsigned char (0 to 255), signed char (-128 to 127)
int (2 or 4 bytes), unsigned int (0 to 65,535 or 0 to 4,294,967,295)
short (2 bytes), unsigned short (0 to 65,535)
long (4 bytes), unsigned long (0 to 4,294,967,295)

Float:   float (4 bytes), 1.2E-38 to 3.4E+38 (6 decimal places)
double (8 bytes), 2.3E-308 to 1.7E+308 (15 decimal places)
long double (10 bytes) 3.4E-4932 to 1.1E+4932 (19 decimal places)

void:    Function Returns, Function Arguments, Pointers to Void

#include <stdio.h>
#include <limits.h>
#include <float.h>
int main() {
printf(“Storage size for int : %d \n”, sizeof(int));

printf(“Storage size for float : %d \n”, sizeof(float));
printf(“Minimum float positive value: %E\n”, FLT_MIN);
printf(“Maximum float positive value: %E\n”, FLT_MAX);
printf(“Precision value: %d\n”, FLT_DIG);

return 0;
}

Copyright © 2025 Anoop's Blogs.

Powered by PressBook WordPress theme