-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendsem.c
More file actions
173 lines (166 loc) · 3.34 KB
/
endsem.c
File metadata and controls
173 lines (166 loc) · 3.34 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// #include<stdio.h>
// //function prototype
// void printHello();
// int main()
// {
// //function call
// printHello();
// return 0;
// }
// //function declaration
// void printHello(){
// printf("Hello World");
// }
// #include<stdio.h>
// int calcSquare( int n);
// int main()
// {
// int square,n;
// printf("Enter the number:");
// scanf("%d",&n);
// printf("the square of number is %d", calcSquare(n));
// return 0;
// }
// int calcSquare( int n ){
// return n*n;
// }
// #include<stdio.h>
// int factorial(int n);
// int main()
// {
// int n;
// printf("enter the number:");
// scanf("%d",&n);
// printf("the factorial of number is %d",factorial(n));
// return 0;
// }
// int factorial( int n){
// if (n==0 || n==1)
// {
// return 1;
// }
// int fact1= factorial(n-1);
// int factn=fact1*n;
// return factn;
// }
// #include<stdio.h>
// int main() {
// int age = 22;
// int *ptr = &age;
// int _age = *ptr;
// printf("%d\n", _age);
// //address
// printf("%p\n", &age);
// printf("%p\n", ptr);
// printf("%p\n", &ptr);
// //data
// printf("%d\n", age);
// printf("%d\n", *ptr);
// printf("%d\n", *(&age));
// return 0;}
// # include <stdio.h>
// void square(int n);
// void _square(int* n);
// int main() {
// int number = 4;
// //call by value
// square(number);
// printf("n is : %d\n", number);
// //call by reference
// _square(&number);
// printf("n is : %d\n", number);
// return 0;
// }
// void square(int n) {
// n = n * n;
// printf("square is : %d\n", n);
// }
// void _square(int* n) {
// *n = *n * *n;
// printf("square is : %d\n", *n);
// }
// # include <stdio.h>
// void swap(int a, int b);
// void _swap(int* a, int *b);
// int main() {
// int x = 3, y = 5;
// //call by value
// swap(x, y);
// printf("x = %d & y = %d\n", x, y);
// //call by reference
// _swap(&x, &y);
// printf("x = %d & y = %d\n", x, y);
// return 0;
// }
// void swap(int a, int b) {
// int t = a;
// a = b;
// b = a;
// }
// void _swap(int* a, int* b) {
// int t = *a;
// *a = *b;
// *b = *a;
// }
// ARRAY
// # include <stdio.h>
// int main() {
// int marks[3];
// printf("physics : ");
// scanf("%d", &marks[0]);
// printf("chem : ");
// scanf("%d", &marks[1]);
// printf("math : ");
// scanf("%d", &marks[2]);
// printf("physics = %d, ", marks[0]); //physics
// printf("chem = %d, ", marks[1]); //chem
// printf("math = %d \n", marks[2]); //math
// return 0;
// }
// # include <stdio.h>
// int main() {
// int age = 22;
// int *ptr = &age;
// int _age = 25;
// int *_ptr = &_age;
// printf("%u\n", ptr);
// ptr++;
// printf("%u\n", ptr);
// ptr--;
// printf("%u\n", ptr);
// ptr = ptr - _ptr;
// printf("%u\n", ptr);
// ptr = &_age;
// printf("%d\n", ptr == _ptr);
// return 0;
// }
// # include <stdio.h>
// void printNumbers(int *arr, int n);
// void _printNumbers(int arr[], int n);
// int main() {
// int arr[] = {1, 2, 3, 4, 5, 6};
// printNumbers(arr, 6);
// printNumbers(arr, 6);
// return 0;
// }
// void printNumbers(int *arr, int n) {
// for(int i=0; i<n; i++) {
// printf("%d : %d\n", i, arr[i]);
// }
// }
// void _printNumbers(int arr[], int n) {
// for(int i=0; i<n; i++) {
// printf("%d : %d\n", i, arr[i]);
// }
// }
#include<stdio.h>
int main()
{
int j=0;
while(j<=10);
{
printf("%d\n",j);
j++;
}
return 0;
}