[C] Tipuri de variabile principale (int , float , char) #5

Post Reply
User avatar
Shadow
Advanced Member
Posts:209
Joined:11 Apr 2015, 15:16
Location:Crema
[C] Tipuri de variabile principale (int , float , char) #5

Post by Shadow » 05 Nov 2015, 09:47

Salut , va voi arata principalele tipuri de variabile si cum se raprezinta aceastea . Am facut un mic program , care printeaza celel 3 tipuri de variabile . 
 
COD C : 

Code: Select all

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

main(){
	int a;
	float b;
	char c;
	printf("Principalele tipuri de variabile :\n");
	a=10;
	b=12.3;
	c='S';
	printf("Tipuri de variabile :  %d \t %f \t %c\n",a,b,c);
	system("pause");
}
Variabilelel de tip int se reprezinta cu : %d . ex : printf("%d",variabila_int);
 
Variabilele de tip float se reprezinta cu %f.  ex : printf("%f",variabila_flaot);
 
Variabilele de tip char se reprezinta cu %c.   ex : printf("%c",variabila_char);
 
 
 
Daca aveti probleme /intrebari , puteti sa scrieti aici . Voi incerca sa va ajut ,
Last edited by Shadow on 05 Nov 2015, 09:48, edited 1 time in total.

Post Reply

Return to “C & C++”

Who is online

Users browsing this forum: No registered users and 2 guests