#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;
}
Answer:
Option is b is correct answer. Excel performs exponentiation, then multiplication and division, then addition, and subtraction, it is correct order of operation in Excel. It is important to remember when you write any formula in Excel having different mathematical operators like +/ -/ ^/ etc, it follows a specific order and performs calculations in specific order which is termed as order of operator precedence. Each of mathematical operator has its precedence and executes in a special order set by Excel.
Explanation:
- As we already know order of precedence of each mathematical operator is different in Excel. The order of operations for Excel is as follows:
- Evaluate elements in parentheses.
- Evaluate 'ranges' ().
- Evaluate 'intersections' (empty spaces).
- Evaluate 'unions' (,).
- Perform negation (-).
- determine percentages (%).
- Perform exponentiation (^).
- Perform multiplication (*) and division (/), both are of equal precedence.
- Perform addition (+) and subtraction (-), both are of equal precedence.
- Evaluate text operators like (&).
- Perform comparisons like (=, <>, <=, >=).
Answer details
Grade: Middle
Subject: Computers and Technology
Chapter: Order of precedence of mathematical operators
Keywords: precedence in Excel, operators precedence etc
Answer:
What Are the Components of a Web Address?
1.Protocol. The first component of a web address is the protocol, which is also known as the scheme. ...
2.Domain Name. The domain name part of the web address is the unique identifier for the website on the internet. ...
3.Domain Extension. ...
4.Path & Filename.