1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
My name is Ann [436]
3 years ago
13

Write a program that accepts a number as input, and prints just the decimal portion. Your program must account for negative numb

ers.
Sample Run
Enter a number: 15.789
Sample Output
0.789
Computers and Technology
1 answer:
sesenic [268]3 years ago
6 0

Answer:here I write code

Explanation:

#include <stdio.h>

int main(void) {

char x[]="" ;

int a,b,Flag=0;

gets(x);

b=sizeof(x);

for(a=0; a<b; a++){

if(x[a]=='.')

Flag=1;

if(Flag==1)

printf("%c",x[a]);

}

return 0;

}

You might be interested in
You are driving in the right lane of a municipal road the road has three lanes in your direction ahead of you in the lane to you
Mrrafil [7]
Pull Over. Do NOT Try to push the brake or try swerving with the steering wheel. Slowly pull to the side
7 0
3 years ago
Read 2 more answers
My friend Leo wants to have an emergency plan for his final exams on University of Southern Algorithmville. He has N subjects to
leonid [27]

Answer:

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following property: At every step, we can make a choice that looks best at the moment, and we get the optimal solution of the complete problem.

If a Greedy Algorithm can solve a problem, then it generally becomes the best method to solve that problem as the Greedy algorithms are in general more efficient than other techniques like Dynamic Programming. But Greedy algorithms cannot always be applied. For example, the Fractional Knapsack problem (See this) can be solved using Greedy, but 0-1 Knapsack cannot be solved using Greedy.

The following are some standard algorithms that are Greedy algorithms.

1) Kruskal’s Minimum Spanning Tree (MST): In Kruskal’s algorithm, we create an MST by picking edges one by one. The Greedy Choice is to pick the smallest weight edge that doesn’t cause a cycle in the MST constructed so far.

2) Prim’s Minimum Spanning Tree: In Prim’s algorithm also, we create an MST by picking edges one by one. We maintain two sets: a set of the vertices already included in MST and the set of the vertices not yet included. The Greedy Choice is to pick the smallest weight edge that connects the two sets.

3) Dijkstra’s Shortest Path: Dijkstra’s algorithm is very similar to Prim’s algorithm. The shortest-path tree is built up, edge by edge. We maintain two sets: a set of the vertices already included in the tree and the set of the vertices not yet included. The Greedy Choice is to pick the edge that connects the two sets and is on the smallest weight path from source to the set that contains not yet included vertices.

4) Huffman Coding: Huffman Coding is a loss-less compression technique. It assigns variable-length bit codes to different characters. The Greedy Choice is to assign the least bit length code to the most frequent character. The greedy algorithms are sometimes also used to get an approximation for Hard optimization problems. For example, the Traveling Salesman Problem is an NP-Hard problem. A Greedy choice for this problem is to pick the nearest unvisited city from the current city at every step. These solutions don’t always produce the best optimal solution but can be used to get an approximately optimal solution.

6 0
3 years ago
explain the following joke: “There are 10 types of people in the world: those who understand binary and those who don’t.”
BigorU [14]

It means that there are people  who understand binary and those that do not understand it. That is, binary is said to be the way that computers are known to express numbers.

<h3>What is the joke about?</h3>

This is known to be a popular  joke that is often  used by people who are known to be great savvy in the field of mathematics.

The joke is known to be one that makes the point that a person is implying that the phrase is about those who only understands the decimal system, and thus relies on numbers in groups of 10.

The binary system is one that relies on numbers that are known to be  in groups of 2.

Therefore, If the speaker of the above phrase is one who is able to understand binary, that person  would  be able to say that that the phrase  is correctly written as  "there are 2 types of people that understand binary".

Learn more about binary from

brainly.com/question/21475482

#SPJ1

8 0
2 years ago
(Please help, Urgent Need): How do I change my username
stealth61 [152]

Answer: create a different one

Explanation:

6 0
3 years ago
How computer viruses spread from one computer to another​
morpeh [17]
Viruses spread when the software or documents they get attached to are transferred from one computer to another using a network, a disk, file sharing methods, or through infected e-mail attachments. Some viruses use different stealth strategies to avoid their detection from anti-virus software.
8 0
3 years ago
Other questions:
  • What is the output of this code? import java.util.HashSet; class A { public static void main(String[ ] args) { HashSet set = new
    15·1 answer
  • Physical parts of components of a computer system is called
    9·1 answer
  • Given a normally distributed data set of 500 observations measuring tree heights in a forest,
    6·1 answer
  • Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the S
    6·1 answer
  • What are the four elements of game design?<br><br> Help Me!!
    9·1 answer
  • How do I write the yearly salary for something without copying it word for word? I'm doing a PowerPoint ( which you had to choos
    15·1 answer
  • After pushing the power switch of the PC to the ʺonʺ position, Bob, the PC repair person, realizes that the power-on lights foun
    8·1 answer
  • How can you make sure to save all annotations from a slide show?
    7·2 answers
  • Write the definition of a void function that takes as input two integer values, say n and m. The function returns the sum and av
    9·1 answer
  • Why did NFL equip its players with RDIF tags?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!