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
GrogVix [38]
3 years ago
5

Anu wishes to prepare a program to display the value of numbers from 1 to 25. The program that Anu prepared is given below. Ther

e are some errors in it. Can you edit the errors?
s=0
for i in range(25):
s=s+i print(s)
Computers and Technology
2 answers:
sergiy2304 [10]3 years ago
5 0

Answer:

Programming is a set of instructions i.e. Input given by the user to the computer to perform a particular task and give the desired result i.e. output.

Final Answer

‌s=0

for i in range(1,26):

s=s+ i

print(s)

Explanation:

IF THE ANSWER IS CORRECT THEN MARK A BRAINLEST

arlik [135]3 years ago
4 0

\tt s=0

\tt for\: i\:in\:range(25)

\tt p=s+i

\tt print(p)

we are done .

You might be interested in
What is the one common feature that ties together different social media technologies? All of the social media tools we use toda
xxTIMURxx [149]
They provide an intersection between technology, social interaction, and the sharing of information
8 0
3 years ago
Read 2 more answers
An anchor tag can be coded using which two attributes?
IceJOKER [234]

Answer:

21212122121221212211212121212212121Explanation:

4 0
2 years ago
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
3 years ago
Read 2 more answers
5.18 LAB: Output numbers in reverse Write a program that reads a list of integers, and outputs those integers in reverse. The in
Rina8888 [55]

Answer:

In C++:

#include<iostream>

#include<vector>

using namespace std;

int main(){

   int len, num;

   vector<int> vect;

   cout<<"Length: ";

   cin>>len;  

   for(int i = 0; i<len;i++){

       cin>>num;

   vect.push_back(num);}

   vector<int>::iterator iter;

   for (iter = vect.end() - 1; iter >= vect.begin(); iter--){

       cout << *iter << ", ";}    

}

Explanation:

This declares the length of vector and input number as integer

   int len, num;

This declares an integer vector

   vector<int> vect;

This prompts the user for length  

cout<<"Length: ";

This gets the input for length  

   cin>>len;  

The following iteration gets input into the vector

<em>    for(int i = 0; i<len;i++){</em>

<em>        cin>>num;</em>

<em>    vect.push_back(num);}</em>

This declares an iterator for the vector

   vector<int>::iterator iter;

The following iterates from the end to the beginning and prints the vector in reverse

<em>    for (iter = vect.end() - 1; iter >= vect.begin(); iter--){</em>

<em>        cout << *iter << ", ";}</em>

<em />

<em />

6 0
3 years ago
What is the purpose of a system call in an operating system?
ikadub [295]

Answer:

 The system call is the programming way for executing the requesting the services in the program from kernel in the particular operating system.

The main purpose of the system call in the operating system is that it basically provide the different types of the services to the users by using the API (Application program interface) system.

It basically provide the interface for allowing the users to request the services between the operating system and a processor. In the linux there are basically three types of system call are as follows:

  • Fork
  • Waitpid
  • Exist

6 0
3 years ago
Other questions:
  • What is an advantage of sharing documents in PDF format instead of Word format?
    6·2 answers
  • identify three of the many shared ethical standards among businesses that are incorporated in codes of ethics
    6·2 answers
  • What is needed to create a good problem statement?
    10·1 answer
  • If a domain consists of dcs that are running versions of windows server earlir than windows server 2008, what replication method
    12·1 answer
  • 1. Create an interface called Runner. The interface has an abstract method called run() that display a message describing the me
    8·1 answer
  • When both gears are the same size what will they produce
    11·1 answer
  • Ashley Baker has been the webmaster for Berryhill Finance only ten days when she received an e-mail that threatened to shut down
    13·1 answer
  • The input to the function/method consists of two arguments.<br><br> a. True<br> b. False
    13·1 answer
  • Give one advantage of saving file in the same folder<br>​
    13·2 answers
  • Is there an alternative website of https://phantomtutors.com/ to get guidance in online classes?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!