Академический Документы
Профессиональный Документы
Культура Документы
1. float V;
const float 𝑛 = 3.142;
int r;
2. #include<stdio.h>
void main()
{
int ball[100];
int red=0;
int blue=0;
char color;
int count=0;
while (count<5)
{
printf("Enter ball color, R for RED Or B for BLUE : ");
scanf(" %c", &color);
if (color=='R')
red=red+1;
if (color == 'B')
blue=blue+1;
count++;
}
printf("RED = %d, BLUE = %d", red, blue);
}
3.
BEGIN
WHILE (LITRE!=-1)
ENTER DISTANCE IN KM
COUNT++
END
4 (a) char letter [ 5 ] = { “N”, “S”, “E”, “A”, “W”};
BEGIN
READ SECOND(S)
HOURS=SECOND/3600
BALANCEHOUR = SECOND%3600
MINUTES=BALANCEHOUR/60
SECONDS=BALANCEHOUR%60
END
6 (b)
#include<stdio.h>
void main()
{
int scienceScore[]={15,18,12,15,17,9,12,16};
int average,eqcount=0,count=0,total=0,i,j,k;
printf("scienceScore[]={15,18,12,15,17,9,12,16} \n");
printf("Number of array elements that has the value less than average : %d \n",count);
if (eqcount!=0)
printf("Yes, the same value exists!");
else
printf("No, the same value does not exist!");
}