Embedded C is perhaps the most popular languages among Embedded Programmers for programming Embedded Systems. There are many popular programming languages like Assembly, BASIC, C++, Python etc. that are often used for developing Embedded Systems but Embedded C remains popular due to its efficiency, less development time and portability.
We will learn this language by following examples.
1.Write a Program to display Sentence.
#include<stdio.h> //Header File
void main() // Main Function
{ //Opening of Program
printf("Welcome to EmbeddedGuru"); //Display Statement in printf() Function
} // Closing of Program
Output:
2.Write a Program to Store User Input Number & Display.
#include<stdio.h> //Header File
void main() // Main Function
{ //Opening of Program
int a; //Variable Declaration
printf("Enter the Number="); //Display Statement in printf() Function
scanf("%d",&a); //Store User Input in scanf() Function.
printf("User Entered Number is %d",a); //Display Statement in printf() Function.
} // Closing of Program
Output:
0 Comments