-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab class 2.txt
93 lines (87 loc) · 1.96 KB
/
lab class 2.txt
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
1.) Write a program in 'C' to print alphabets using printf function.
#include<stdio.h>
int main()
{
printf("abcpqr");
return 0;
}
abcpqr
-----------------------------------------
2.) Write a program in 'C' to print name, roll no. and branch using printf function.
#include<stdio.h>
int main()
{
printf("Mukul Misra CSE 21052082");
return 0;
}
Mukul Misra CSE 21052082
-----------------------------------------
3.) Write a program in 'C' to print name, roll no. and branch using printf function in different lines using \n operator.
#include<stdio.h>
int main()
{
printf("Mukul Misra\n");
printf("21052082\n");
printf("CSE branch");
return 0;
}
Mukul Misra
21052082
CSE branch
-----------------------------------------
4.) Write a program in 'C' to print the given pattern using printf function.
*
**
***
****
*****
#include<stdio.h>
int main()
{
printf("*\n**\n***\n****\n*****\n");
return 0;
}
*
**
***
****
*****
----------------------------------------
5.) Write a program in 'C' to print the given pattern using printf function.
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
int main()
{
printf(" *\n * *\n * * *\n * * * *\n* * * * *\n");
return 0;
}
*
* *
* * *
* * * *
* * * * *
----------------------------------------
6.) Write a program in 'C' to print the pattern of word KIIT (in * sign) using printf function.
#include<stdio.h>
int main()
{
printf("* * * * * * * * * * *\n");
printf("* * * * *\n");
printf("* * * * *\n");
printf("* * * * *\n");
printf("* * * * *\n");
printf("* * * * *\n");
printf("* * * * *\n");
return 0;
}
* * * * * * * * * * *
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *