In this class, I learned about the basic output function to print the context (e.g., numbers, characters, symbols).
In order to output numbers, symbols, etc., it can be used in parentheses of printf().
Remember to always put a semicolon at the end of the code.

1. Text

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
	printf("My name is \n Filbert");	
	return 0;
}

If a line change is required within the written text, it should be added "\n".

 

2. Number

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
	printf("%d", 12345");	
	return 0;
}

 

3. Characters

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
    printf("  *  \n");
    printf(" *** \n");
    printf("*****\n");
    
    return 0;
}

 

In this class, I learned about the basic steps to start language "C".
To this end, the "Dev C++" program was first installed to comply with the integrated development environment (IDE).

To verify that the installation was completed normally, I tried to output the text "Hello C World".

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
	printf("Hello C World");
	
	return 0;
}

 

In order to print out the letter "Hello C World", it must be printed with a "printf" output function inside the main() function. And the result showed as below.

 

 

 

This code can be saved first and then compiled to see the execution results.
As a result, it can be seen that the IDE environment setting was successfully complete.

+ Recent posts