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
sukhopar [10]
2 years ago
5

What is the best way to locate where my C program gets into an infinite loop

Computers and Technology
1 answer:
Anni [7]2 years ago
5 0
You could put in a printf() statement to print the value of the index into each loop that you have. You can also step through each loop and read EXACTLY what the program is doing. This is a good skill to develop because your mind has a habit of "fixing" small errors that computers don't.

Computers do exactly what they're told to do, not what you want the to do.
You might be interested in
The photo-sharing site Instagram owed a good deal of its success to filters. What are filters?
creativ13 [48]

Adding a filter to a picture can change the whole effect of the picture. Say you wanted a more vintage theme for your picture, you could use a black and white theme to give it an old timey feel. Different filters can add effects to the picture, maybe the filter gives your picture a blueish cool toned tint, or maybe it adds more light to the filter.

6 0
3 years ago
Read 2 more answers
write a function issorted() that accepts an array of real numbers arr and an integer n as arguments, where n is the size of arr.
lesantik [10]

Answer:

Here is code in java.

import java.util.*;

class Main

{

//main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       int m;

        // scanner object to read input from user

       Scanner ss=new Scanner(System.in);

       System.out.println(" size  of the array:");

       //read the size of the array

        m=ss.nextInt();

        // create array of the given size

        float arr[]=new float[m];

        /* call function to check whether input are in the ascending sorted order or not */

        Boolean res= issorted(arr,m);

       

      // print the result

       System.out.println("array in the ascending sorted order  : "+res);

     

       

   }catch(Exception ex){

       return;}

}

 // function to check whether input are in the ascending sorted order or not

public static boolean issorted(float[] arr,int n)

{

    int i,j;

    float d;

    Boolean flag=true;

    Scanner ss=new Scanner(System.in);

    System.out.println("enter the elements of the array:");

     // read elements of the array

    for(i=0;i<n;i++)

    {

        arr[i]=ss.nextFloat();

    }

   

    // check elements re in the ascending order or not

    for(j=0;j<n-1;j++)

    {

        if(arr[j]>arr[j+1])

        {

            flag=false;

            break;

        }

    }

     // return the result

    return flag;

}

}

Explanation:

With the help of scanner class object, read the size "m" of array.Create an array of  the given size. Pass array and integer into the function issorted(). Read the elements of the array and then check elements are in the ascending order or not.It will return "true" if elements are in the sorted order else it will return "false".

Output:

enter  size  of the array:                                                                                                                                    

5                                                                                                                                                              

enter the elements of the array:                                                                                                                              

1 2 3 4 7                                                                                                                                                      

array in the ascending sorted order  : true                                                                                                                              

enter  size  of the array:                                                  

5                                                                            

enter the elements of the array:                                              

2 4 9 3 5                                                                  

array in the ascending sorted order  : false

7 0
3 years ago
The term that best exemplifles the freedom to spend your money the want to is
e-lub [12.9K]
Want to spend it on things u need THEN you can buy what you wNt
6 0
3 years ago
To read encrypted data, the recipient must decipher it into a readable form. what is the term for this process? re-securing decr
devlian [24]
Decryption. When you use the same key for encryption as decryption, this is called symmetric encryption. When the keys are different, it is called asymmetric encryption.
5 0
2 years ago
A two-dimensional array has been defined to hold the quantity of each of 5 different healthy snack products sold in a tuckshop d
Olegator [25]

Answer:

1

Explanation:

[0] = 1

[1] = 2

[3] = 3

and so on...

3 0
2 years ago
Other questions:
  • Question 3 / 5
    9·1 answer
  • Which of the following tasks would a database administrator perform ? A identify computer security photos, B. Make sure protocol
    15·1 answer
  • Which of the following is a Microsoft solution that runs on a Microsoft Terminal Services server but appears, to end users, as i
    10·1 answer
  • In modern computer memory, each location is normally composed of one byte.
    7·1 answer
  • In a binary search, _______________________________ . a. It is assumed that all of the elements are integers. b. It is assumed t
    6·1 answer
  • The process of adding a header to the data inherited from the layer above is called what option below
    8·1 answer
  • 1. Railroad tracks present no problems for a motorcyclist.
    8·1 answer
  • Write a partial class that shows a class constant and an instance method. Write an instance method that converts feet to inches
    9·1 answer
  • Help please im not sure what this means T^T
    12·2 answers
  • You want to connect the LAN port on a router to the uplink port on a switch. The switch does not support auto-MDI. Which type of
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!