-
Notifications
You must be signed in to change notification settings - Fork 0
/
week 1 in C
83 lines (58 loc) · 1.56 KB
/
week 1 in 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
<1> "Hello World!" in C
This challenge requires you to print on a single line, and then print the already provided input string to stdout. If you are not familiar with C, you may want to read about the printf() command.
Example
The required output is:
Hello, World!
Life is beautiful
Function Descriptio
Complete the main() function below.
The main() function has the following input:
string s: a string
Prints
*two strings: * "Hello, World!" on one line and the input string on the next line.
Input Format
There is one line of text, .
Sample Input 0
Welcome to C programming.
Sample Output 0
Hello, World!
Welcome to C programming.
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
char s[100];
scanf("%[^\n]%*c", &s);
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
return 0;
}
<2> Playing With Characters
Task
You have to print the character, , in the first line. Then print in next line. In the last line print the sentence, .
Input Format
First, take a character, as input.
Then take the string, as input.
Lastly, take the sentence as input.
Output Format
Print three lines of output. The first line prints the character, .
The second line prints the string, .
The third line prints the sentence, .
Sample Input 0
C
Language
Welcome To C!!
Sample Output 0
C
Language
Welcome To C!!
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
return 0;
}