Composition- a work of music, literature, or art
This is important because art helps people express oneself
I believe it is D. The Central Processing Unit (CPU) can manage memory and storage. It also makes sure every program has what it needs to keep it up and running.
<u>Answer:</u>
<em>There are 2 ways to do extract the decimal part:
</em>
<u>Explanation:</u>
- <em>First method using number </em>
<em>int main() {
</em>
<em> double num = 23.345;
</em>
<em> int intpart = (int)num;
</em>
<em> double decpart = num - intpart;
</em>
<em> printf(""Num = %f, intpart = %d, decpart = %f\n"", num, intpart, decpart);
</em>
<em>}
</em>
- <em>Second method using string:
</em>
<em>#include <stdlib.h>
</em>
<em>int main()
</em>
<em>{
</em>
<em> char* inStr = ""123.4567""; </em>
<em> char* endptr;
</em>
<em> char* loc = strchr(inStr, '.');
</em>
<em> long mantissa = strtod(loc+1, endptr);
</em>
<em> long whole = strtod(inStr, endptr); </em>
<em> printf(""whole: %d \n"", whole); </em>
<em> printf(""mantissa: %d"", mantissa);
</em>
<em>}
</em>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body class="YellowBackground">
<style>
.YellowBackground {
background-color:yellow;
}
</style>
</body>
</html>
Like this?
Answer:
import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("Input a word: ");
String userinput = input.nextLine();
for(int i =0;i<userinput.length();i+=2) {
System.out.print(userinput.charAt(i));
}
}
}
Explanation:
This line prompts user for input
System.out.print("Input a word: ");
This declares a string variable named userinput and also gets input from the user
String userinput = input.nextLine();
The following iterates through every other character of userinput from the first using iteration variable i and i is incremented by 2
for(int i =0;i<userinput.length();i+=2) {
This prints characters at i-th position
System.out.print(userinput.charAt(i));