C Programming Practice Problems Solutions

C Programming Practice Problems and Solutions

1. Calculate Sum and Percentage of 5 Subjects

Write a C program (WAP) that accepts the marks of 5 subjects and finds the sum and percentage.

#include <stdio.h>
int main()
{
    int marks[5];
    int total = 0;
    float percentage;

    printf("Enter marks for 5 subjects:\n");
    for(int i = 0; i < 5; i++)
    {
        scanf("%d", &marks[i]);
        total += marks[i];
    }

    percentage = (total / 5.0);
    printf("Sum: %d\n", total);
Read More

Healthy Romantic Relationships: Love Languages, Sex, Conflict & Repair

Chapter 8 – Making a Love Connection

1) What are the love languages (5)?

Words of affirmation — verbal compliments, “I love you,” expressions of appreciation.

Quality time — focused, undivided attention; doing things together; being present.

Gifts/tokens — thoughtful items that show “I was thinking about you.”

Acts of service — helpful actions such as chores, errands, favors.

Physical touch — hand-holding, hugging, cuddling, kissing, sexual touch.

2) What is the difference between liking,

Read More

C Programs: String, Array, Pointer & Control Examples

Section 1: String Programs

1. Reverse Individual Characters of a String

Language: C

#include <stdio.h>
#include <string.h>

int main() {
    char str[100];
    int length, i;
    printf("Enter a string: ");
    fgets(str, sizeof(str), stdin);
    length = strlen(str);
    if (length > 0 && str[length - 1] == '\n') {
        str[length - 1] = '\0';
        length--;
    }
    printf("The string in reverse order is: ");
    for (i = length - 1; i >= 0; i--) {
        printf(
Read More

Understanding Key Communication Theories in Social Interaction

Symbolic Interactionism (Chapter 5)

  • Symbolic interaction: The idea that people create meaning through language and symbols in social interaction.

  • Minding: The inner dialogue we use to rehearse how others might react to our actions before we act.

  • Taking the role of the other: Imagining how another person sees a situation to guide our behavior.

  • Looking-glass self: The idea that our self-concept is shaped by how we think others view us.

  • “I” vs “Me”:

    • “I” = spontaneous, unpredictable, creative

Read More

The Foundations of Value Education and Human Harmony

Understanding Value Education

The Concept of Value Education

Defining Human Values

  • Goodness that guides human interaction:
    • Respect
    • Acceptance
    • Empathy
    • Love
  • Enabling ethical practice:
    • Justice
    • Integrity
  • A tool for achieving harmony and peace.

Core Human Values

  • Right Conduct
    • Self-help skills
    • Social and ethical skills
  • Peace
    • Calmness
    • Contentment
    • Self-control
  • Truth
    • Honesty
    • Integrity
    • Quest for knowledge
  • Love
    • Acceptance
    • Care and compassion
    • Generosity
  • Non-violence
    • Benevolence
    • Harmlessness

Factors Influencing Human Values

  • Assertiveness
    • Expressing
Read More

English Word Formation: Nouns, Verbs, Adjectives, and Adverbs

English Word Families: A Reference Table

This reference organizes related words by their part of speech, demonstrating common patterns in English word formation (morphology). Note that some cells may be empty if the corresponding form is rare or non-existent.

Core Word Families (A-L)

NounPerson/AgentVerbAdjectiveAdverb
NounPersonTo VerbAdjectiveAdverb
BeliefBelieverTo BelieveBelievableBelievably
BreadthTo BroadenBroadBroadly
ClearanceTo ClearClearClearly
DepthTo DeepenDeepDeeply
HeightTo HighlightHighHighly
Length
Read More