#22 is 1s and 0s, hope that helps a little bit
#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;
}
B.
it's literally common sense
Answer:
You would put the cursor after the letter v in vermont and press back space and type a capital V to make it Vermont.
Answer:
Option B is the correct answer for the above question.
Explanation:
The control structure is a decision type structure which can be either true or false. It has two options-- If this then, does this otherwise do this. When the user wants to write he control structure then he can do this by the help of the following syntax in python language--
if(condition):
do this
else:
do this
The above question wants to ask about the concept which is used in the programming for a decision then the answer is control structure which is referred from the option B. Hence B is the correct option while the other is not because--
- Option A states about the flowchart which is the picture form of the instruction.
- Option C states about the pseudocode which is the language form of the instruction.
- The operator is also not the correct option because it is used to perform the operation.