-
Notifications
You must be signed in to change notification settings - Fork 0
/
Printf.c.c
35 lines (32 loc) · 943 Bytes
/
Printf.c.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// C variables
#include<stdio.h>
int main()
{
int studentid = 15;
int studentage = 23;
float studentfee = 34;
char studentgrade = 'A';
printf("------------------------------\n");
printf("Student id: %d\t\n", studentid);
printf("Student age: %d\t\n",studentage);
printf("Student Fee: %d\t\n]",studentfee);
printf("Student Grade: %d\t\n",studentgrade);
printf("----------------------------------\n");
int myNum = 15;
int myanotherNum;
float myFloatNum = 3.323;
char myLetter = 'R';
myanotherNum = myNum;
printf("\nMy Number: %d", myNum);
printf("\nMy Float Number: %f", myFloatNum);
printf("\nMy Letter: %c", myLetter);
printf("\nMy number is %d and my Letter is %c", myNum, myLetter);
printf("-------------------------------------\n");
int myInt;
float myFloat;
double myDouble;
printf("%1u\n",sizeof(myInt));
printf("%1u\n",sizeof(myFloat));
printf("%1u\n",sizeof(myDouble));
return 0;
}