WAPT Input 12 Player
WAPT Input 12 Player
Algorithm:
FLOWCHART
CODE
#include <stdio.h>
int main() {
float average;
scanf("%d", &ages[0]);
scanf("%d", &ages[1]);
printf("Enter age of player 3: ");
scanf("%d", &ages[2]);
scanf("%d", &ages[3]);
scanf("%d", &ages[4]);
scanf("%d", &ages[5]);
scanf("%d", &ages[6]);
scanf("%d", &ages[7]);
scanf("%d", &ages[8]);
scanf("%d", &ages[9]);
scanf("%d", &ages[10]);
scanf("%d", &ages[11]);
// Calculate average
return 0;
2) WAPT read and display roll number, three subject marks, total and percentage from user.
FLOWCHART
CODE
#include <stdio.h>
int main() {
int roll_number;
float subject1, subject2, subject3, total, percentage;
return 0;
}
ALGORITHM
FLOW CHART
CODE
#include <stdio.h>
int main() {
scanf("%f", &length);
scanf("%f", &radius);
// Display results
return 0;
}
4) WAPT calculate Simple Interest.(SI=P*R*N) P=principle amount R= rate of interest N=no of year
Code
#include <stdio.h>
int main() {
float P, R, N, SI;
scanf("%f", &P);
scanf("%f", &R);
scanf("%f", &N);
// Calculate Simple Interest
SI = P * R * N;
return 0;
5) WAPT input 2 values and to Changing (swapping) value of two variables using use of third
variable. Eg: a=10 b=20 c=0 Output : a=20 b=10
Code
#include <stdio.h>
int main() {
int a, b, c;
scanf("%d", &a);
scanf("%d", &b);
c = a; // Store value of a in c
a = b; // Assign value of b to a
b = c; // Assign value of c to b
printf("\nAfter swapping:\n");
return 0;
6) WAPT input 2 values and to Changing(swapping) value of two variables without use of third
variable.
#include <stdio.h>
int main() {
int a, b;
scanf("%d", &a);
scanf("%d", &b);
printf("\nAfter swapping:\n");
return 0;
#include <stdio.h>
int main() {
int num;
// Step 1: Input a number
scanf("%d", &num);
if (num % 2 == 0) {
} else {
return 0;
8) WAPT find the distance between 2 cities (in Kilometer) is input through K/B.WAPT convert &
print this distance in meter, inch, feet and centimeter
#include <stdio.h>
int main() {
scanf("%f", &distance_km);
return 0;
}
9) WAPT find whether the Given Number is a Prime Number.
#include <stdio.h>
int main() {
scanf("%d", &num);
if (num <= 1) {
is_prime = 0; // Numbers <= 1 are not prime
} else {
if (num % i == 0) {
break;
if (is_prime) {
} else {
return 0;
#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
if (num > 0) {
} else {
printf("The number is zero.\n");
return 0;
#include <stdio.h>
int main() {
char ch;
scanf("%c", &ch);
// Step 2: Check if the character is a vowel or consonant
} else {
return 0;
13) WAPT read a cost price, selling price of an item, program to determine whether the seller has
been made profit or loss.
#include <stdio.h>
int main() {
scanf("%f", &cp);
scanf("%f", &sp);
profit = sp - cp;
loss = cp - sp;
} else {
return 0;
int main() {
int year;
scanf("%d", &year);
// Step 2: Check for leap year
} else { // This 'else' matches the inner 'if' checking divisibility by 400
} else { // This 'else' matches the second 'if' checking divisibility by 100
return 0;
15) WAPT in c to input any character if it is in upper case, lower case, digit or space.
#include <stdio.h>
int main() {
char ch;
scanf("%c", &ch);
if (isupper(ch)) {
} else if (islower(ch)) {
} else if (isdigit(ch)) {
} else if (isspace(ch)) {
printf("The character is a space.\n");
} else {
return 0;
16) WAPT read a character from keyboard and print it in reverse case. For example enter the
character: a(lower case) then the output will be return A(upper case)
#incl
ude <stdio.h>
char ch;
scanf("%c", &ch);
return 0;
17) Write a program to calculate result according to following rules. Take input roll no, name, m1,
m2, m3, m4 and calculate percentage, result and class. The class is declared on the following
criteria. If per>=70, class=”Distinction” If per>=60 and per=50 and per=40 and per
18) Program to Check Whether the Given Number is an Armstrong Number or not. Example:153 is
Armstrong number because (1*1*1+5*5*5+3*3*3)=(1+125+27)=153
19) Program to Print the Numbers Which are Divisible by 5 and 7 from First 100 Natural Numbers
#include <stdio.h>
int main() {
if (i % 5 == 0 && i % 7 == 0) {
return 0;
20) Program to Reverse a Given Number. Ex:enter number 1234 revers print 4321