Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8843307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:11:14+00:00 2026-06-14T11:11:14+00:00

I was coding some homework (101 level). When I tried to compile the code,

  • 0

I was coding some homework (101 level). When I tried to compile the code, I got some virus alert from bit defender:

#include <stdio.h>

int main ( void ) {
int numbers [10];
int i, temp;

for (i = 1; i <= 10; ++i)
    numbers[i] = 0;

printf("Enter up to 10 integers. input '-1' to finish \n");

for (i = 0; i < 10; i++) {
    scanf("%d", &temp);
    if (temp == -1) {
        break;
    } else {
        numbers [i] = temp - 1;
    }
}

for (i = 1; i <= 10; ++i)
    printf("the numbers are: %d\n", numbers[i]);

return 0;
}

virus alert print screen

I believe the problem is with this piece of code:

    for (i = 1; i <= 10; ++i)
        numbers[i] = 0;

Why the trojan virus alert? what did I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:11:16+00:00Added an answer on June 14, 2026 at 11:11 am

    Don’t pay attention some antivirus programs recognize the compiled items as virus, it does the same avast with visual studio, just add exception to your antivirus list.
    But your code has some problems indeed.

    • for (i = 1; i <= 10; ++i) is incorrect, because the arrays in C start on 0, and second to initialize variables you don’t need to do for loops you can assign them values like any other variable.
    • numbers [i] = temp - 1 The way you store the values in the array is not so good, because you are altering the inputed values when you do -1.

    a

    /*For the array initialization.*/
    int numbers[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
    

    /*For inputing the values.*/
    
    for ( i = 0; i < 10; i++ ){
        scanf( "%d", &temp );
        if( temp == -1 ){
            numbers[ i ] = -1;
            break;
        else{
            numbers[ i ] = temp;
        }
    }
    

    /*For the printing. */
    
    for( i = 0; i < 10 ; i++ ){
        if( numbers[ i ] == -1 ){
            break;
        }
        printf( "numbers[%d] is %d", i, numbers[ i ] );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am coding some program that among many other operations have one that from
Im trying to do some coding about improving the iPhone positioning accuracy. I got
I'm coding some c# against Active Directory and have tried endlessly to get this
I am having problems coding some of my buttons. This is what I've got
I'm coding some ActionScript 3 app that needs to request some HTML page and
I am currently coding some chat program and now want to play music via
I have an application developed in Grails 2.0.4, I am hard coding some of
I'm currently working on some coding for a hotel booking widget and am using
I've noticed in some coding people use icicle with the onCreate method, and I
I've been messing around with some coding and finally think I'm finally ready for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.