1.The average length-> 7200
2.A packet of toffee-> 36
3.An apple weighs-> NOT
4.A courier clerk-> NOT
5.A batsman-> 33
6.The average age 20yrs-> 15
7.In a coconut-> 4
8. If the average-> 8
9.The average of 61-> 80
10.If the average-> 3 M*M
11.The average 7 distinct-> 5
12.A student's mark-> 60
13.The average three-> 22
14.In a factor-> 768
15.Three friends-> 620/7 kgs
16.The ratio of arithmetic-> 1:5
17.A batsman-> 20%
18.The average of marks-> 100
19.A library-> 285
20.16 men-> Rs.1360
21.The average weight-> 56 kgs
22.A board has-> NOT
23.The average of 20-> 8
24.In the first-> 6.46
25.Six people-> 56
Program solution:
1. C- Function - Vowel Count(Id-5284)
#include<stdio.h>
int countVowels(char *s){
int count=0;
for(int c=0;c<strlen(s);c++){
if(s[c]=='a'||s[c]=='e'||s[c]=='i'||s[c]=='o'||s[c]=='u'||s[c]=='A'||s[c]=='E'||s[c]=='I'||s[c]=='O'||s[c]=='U'){
count+=1;
}
}
return(count);
}
int main(){
char str[1001];
scanf("%s",str);
printf("%d", countVowels(str));
}
2. C-Function - Average (Id-5303)
#include<stdio.h>
void setAverage(int values[], int n, double *average){
double a;
for(int i=0;i<n;i++){
a+=values[i];
}
*average=(a/(n*1.0));
}
int main(){
int N, index;
double average=0;
scanf("%d",&N);
int values[N];
for(index=0;index<=N-1; index++){
scanf("%d", &values[index]);
}
setAverage(values, N, &average);
printf("%.2f", average);
}
0 Comments