systemappsprogram.blogspot.com

C - Basic Syntax

Basic Code With Keywords **// 
"Declare variables" 
int age;
Image result for c programming languageprintf("Hello, World! \n")
printf("Hello, World! \n"); return 0;/* my first program in C */ 
fruit = apples + oranges; // get the total fruit
 #include <stdio.h> #include  
<float.h> int main() 
{ 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; }
extern int d = 3, f = 5; // declaration of d and f.
 int d = 3, f = 5; // definition and initializing d and f.
 byte z = 22; // definition and initializes z.
 char x = 'x'; // the variable x has the value 'x'.
#include <stdio.h> // Variable declaration: 
 extern int a, b; extern int c; extern float f; int main () { /* variable definition: */ 
 int a, b; int c; float f; /* actual initialization */ 
 a = 10; b = 20; c = a + b; 
printf("value of c : %d \n", c); 
 f = 70.0/3.0; 
 printf("value of f : %f \n", f);
  return 0; }
// function declaration
  int func(); int main()  
{ // function call int i = func(); } 
 // function definition int func() 
 { return 0; }
 int g = 20; // valid statement 10 = 20; //
invalid statement; would generate compile-time error
 #include <stdio.h>
  #define LENGTH 10  
#define WIDTH 5 
 #define NEWLINE '\n' 
 int main()  
{ int area; 
 area = LENGTH * WIDTH; 
 printf("value of area : %d", area); 
 printf("%c", NEWLINE); 
 return 0; }
 #include <stdio.h>  
int main() 
{ const int LENGTH = 10;  
const int WIDTH = 5;  
const char NEWLINE = '\n'; 
 int area; area = LENGTH * WIDTH; 
 printf("value of area : %d", area); 
 printf("%c", NEWLINE);
  return 0; }





Share:

No comments:

Translate

Popular Posts

Recent Posts

Support System Software

Customer support is usually one of the key aspects for all companies, both small and large enterprises. Having a reliable customer support system will result in a positive image of your brand and will be a clear sing that you actually care about your clients and put effort into keeping them satisfied. Our team of SaaS experts have collected and tested all popular customer support software services currently available in the market. Our list should allow you to more easily decide which solution will work best for your business. Need our help to upload or customize this blogger template? Contact me with details about the theme customization you need.