#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:
The correct option for this question is File.
Explanation:
Answer:
e. tests each program separately.
Explanation:
Unit testing -
It is one of the software testing where the individual units are tested , is referred to as unit testing.
The focus of this step is to scan each and every unit separately and thoroughly so as to avoid any type of damage or malfunctioning .
Hence, from the question, the correct statement for unit testing is e. tests each program separately.
Answer:
Convert 1.5GB to KBs = 1500000kb
1500000kb/950kb ≈ 1579
Explanation:
Output of the given code is:
Y
X
Y
Y
X
Y
XY
Y
X
Y
Y
X
Y
XY
Y
X
Y
Y
X
Y
XY
Y
X
Explanation:
In the for loop variable "number" will iterate from 1 to 150(inclusive).
in the "if" condition it is checking that the number is divisible by 3 and 5 both if the number is divisible by both 3 & 5 then it will print XY as output.
In the first "elif", if the number is divisible by 5 only then it will print X
as output.And in the last "elif", if number is divisible by 3 only then it will
print Y as output. Nothing will be printed if all three conditions are FALSE.