-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLearninggcc.c
156 lines (123 loc) · 3.11 KB
/
Learninggcc.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// Name Ankesh Sharma
// Date 03-01-2024
// Language C
#include <stdio.h>
#include <conio.h>
// int main2();
// int sumprogram(int a,int b);
// int incrementpostpreboth();
int logicaloperators();
// int floatthevalue();
// int charactervalue();
// int pointervalue();
// int scanffunction();
// int signedint();
// int stringvalue();
// int sizeofvar();
// int mainforarray();
// int mainpointer();
// int mainobject();
// int mainenum();
// int printcharasciivalue();
int noreusable(int a,int b ,int f,int j,int m);
int main(){
// int a = 12;
// int b= 30;
// printf("\tHello Students");
// getch();
// printf("\r");
// getch();
// printf("welcome to Bytexl\t");
// getch();
// main2();
// floatthevalue();
// charactervalue();
// stringvalue();
// pointervalue();
// sizeofvar();
// signedint();
// mainforarray();
// mainpointer();
// mainobject();
// mainenum();
// printcharasciivalue();
// scanffunction(a,b);
// sumprogram(10,20);
// noreusable(902,-16,28,72,87);
// incrementpostpreboth();
logicaloperators();
// printf("%d",sum);
}
// Foramt Specifiers {%d}
int main2(){
int a = 20;
printf("the %d Value %d is the %d value of a",a,a);
}
// Foramt Specifiers {%f} float
int floatthevalue(){
float a = 13.65;
printf("The value we aare obtaining for a is a floating value %.1f",a);
}
// Foramt Specifiers {%c} character
int charactervalue(){
char a = 'A';
printf("The value of the character a is %c",a);
}
// Foramt Specifiers {%s} string
int stringvalue(){
char a[] = "Hello There";
printf("The value of a is string and the value is %s",a);
}
// Foramt Specifiers {%p} pointer
// int pointervalue(){
// int value = 42;
// printf("The value of pointer can be like this %p",pointer);
// }
// Size of variables
// int sizeofvar(){
// long long int value1 = 992836844736363;
// printf("The value of the long int variable is %ld", value1);
// }
int signedint(){
int a = 6545662;
printf("%d",a);
}
int mainforarray() {
int numbers[5] = {10, 20, 30, 40, 50};
printf("Element 1: %d\n", numbers[0]);
printf("Element 2: %d\n", numbers[1]);
printf("Element 3: %d\n", numbers[2]);
printf("Element 4: %d\n", numbers[3]);
printf("Element 5: %d\n", numbers[4]);
}
int printcharasciivalue(){
char a = 69;
printf("Here is the Ascii value of c %c",a);
}
int scanffunction(){
int a;
int b;
scanf("please enter the value of a = %d please enter the value of b = %d\n",&a,&b);
printf("the entered value of a = %d and b= %d",a,b);
}
int sumprogram(int a,int b){
printf("The sum is %d",a+b);
}
// no reusbility
int noreusable(int a,int c,int b,int j,int k){
printf("Enter the value for a%d the value of b %d");
scanf("%d%d",&a,&b);
c = a+b;
printf("the sum is %d",c);
getch();
}
int incrementpostpreboth(){
int x,y;
x = 5;
// y=x++; //post increment
y=++x; //pre increment
printf("The value of x is %d and y is %d",x,y);
}
int logicaloperators(){
printf("%d",5>4>3);
}