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
Tasya [4]
3 years ago
9

Write a program to test the difference between %d and %i conversion

Computers and Technology
1 answer:
Gelneren [198K]3 years ago
7 0
Void test(char *s)
{
  int i, d;
  sscanf(s, "%i", &i);
  printf("%s converts to %i using %%i\n", s, i);
  sscanf(s, "%d", &d);
  printf("%s converts to %d using %%d\n", s, d);
}

int main()
{
  test("123");
  test("0x123");
  return 0;
}

outputs:
123 converts to 123 using %i
123 converts to 123 using %d
0x123 converts to 291 using %i
0x123 converts to 0 using %d

As you can see, %i is capable of parsing hexadecimal, whereas %d is not. For printf they're the same.
You might be interested in
A company database consists of 10,000 sorted names, 40% of whom are known as good customers and who together account for 60% of
vladimir2022 [97]

Answer:

The answer is "binary search= 5.111 and Linear seacrch= 6400".

Explanation:

Following are the description of this question:

  • Binary Search-The performance with single arrays is log 10000 = 4, through the use of two arrays (60/100)*log4000 + (40/100)*(log4000 + log6000) = 5.111.  
  • In the linear search: while doing static searches, 10000 would be performed, and (60/100)*4000 + (40/100)*6000 = 6400 will be used with two arrays.  
  • It's a special case, that will be used in one of the arrays in a binary search. Whereas good case uses linear frames, two frames are used, as indicated above.
7 0
3 years ago
Which wireless communication is typically limited to six feet of distance?
Anni [7]

Answer:

nfc

Explanation:

8 0
4 years ago
____ is used specifically for the purpose of recording keystrokes, logging the programs or web sites accessed, or otherwise moni
Hunter-Best [27]
A. computer monitoring software
5 0
3 years ago
Read 2 more answers
HELP ME PLEASE
MAXImum [283]

Explanation:

Threats

Computer Security Threats are possible dangers that can affect the smooth functioning of your PC. These may be a small piece of adware or a harmful Trojan malware. In the present age, computer security threats are constantly increasing as the world is going digital. computer security threats

Types of Computer Security Threats

There are several types of computer security threats such as Trojans, Virus, Adware, Malware, Rootkit, hackers and much more. Check some of the most harmful types of computer Security Threats.

COMPUTER VIRUS

A Computer Virus is a malicious program, which replicates itself and infects the files and programs of your PC and can make them non-functional.

COMPUTER WORMS

A self-replicating computer program that spreads malicious codes, computer worms make use of the network to send copies of the original codes to other PCS. It can also go to the extent of sending transferring documents utilizing the email of the user.

SCAREWARE

Scareware is a malware that tricks victims to buy software by displaying fake virus alerts. A scareware infected PC may get pop-ups of fake malware threats and to get rid of those, users are prompted to purchase a fake anti-malware software.

KEYLOGGER

Also known as a keystroke logger, Keyloggers can track the real-time activity of a user on his computer. Keylogger runs in the background and records all keystrokes made by a user and passes the information to the hacker with the motive to steal password and banking details.

ROOTKIT

A rootkit is considered extremely dangerous as they appear to be legitimate files and deceives the computer user. Rootkit masks viruses and worms and makes them appear as necessary files. These are very difficult to remove and only an antivirus with the anti-rootkit feature can remove a rootkit.

Tips for Best Computer Security

For best computer security, you must follow certain guidelines, which are also called computer best practices. 1. Use the best antivirus software, which not only provides protection to your PC but also internet protection and guards against cyber threats. 2. Do not download untrusted email attachments and these may carry harmful malware. 3. Never download software from unreliable sites as they may come with a virus that may infect your system as soon as you install the software.

4 0
2 years ago
Which Boolean operator enables you to exclude a search term?
Lisa [10]

It is letter D. but i might be incorrect, please contact your teacher for further information. sorry if I got your answer wrong... :(

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which computer device helps you input data in the form of text, numbers, and commands?
    9·1 answer
  • What is the difference between a router and a modem
    15·1 answer
  • Apple's macOS and Microsoft Windows are examples of ________ software. utility application communication operating system
    13·1 answer
  • 1st row has 3 possible answers software program, web page, and web browser
    8·1 answer
  • I live in Pennsylvania which observes eastern standard time.
    13·1 answer
  • Which of the following is NOT a font style?<br> Italic<br> Bold<br> Regular<br> Iconic
    10·2 answers
  • WILL GIVE A BRAINLIEST!!! PLS HELP!!!
    9·1 answer
  • Answer pls pls pls pls ​
    13·1 answer
  • An independent penetration testing company is invited to test a company's legacy banking application developed for Android phone
    13·1 answer
  • which filename refers to a 16-bit real-mode program that queries the system for device and configuration data, and then passes i
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!