Category: C Programming

  • Dynamic string manipulation and memory allocation in C.

    I need help writing a C program that reads a line of text from the user of an unknown length, dynamically allocates memory for it using malloc or realloc, reverses the string in place, and prints the result. The program must handle memory management properly, ensuring there are no memory leaks, and should free all allocated memory before exiting. Please include comments explaining the pointer logic.

  • Write a C Program to find a even numbers which hidden in 2 t…

    Write a C Program to find a even numbers which hidden in 2 to 10 tables

  • what will be the output for the following C program?

    #include <stdio.h>

    int main() {
    int a = 5;
    int b = a++ + ++a + a a;

    printf(“%d %d”, a, b)

    return 0;
    }

  • Output of the code

    Int n=scanf(“%d”,&n);

    int a=printf(“%d”,n);

    printf(“%d”,a);

  • 1. What are the main data types in C?

    – Language Standard: ANSI C / C89 or C99

  • Write a C program to reverse a string using pointers without…

    Problem Description:

    Write a C program to reverse a string using pointers. The program should take a string input from the user and display both the original and reversed string.

    Technical Requirements:

    – Programming Language: C

    – Language Standard: C99 or later

    – Compiler: GCC (GNU Compiler Collection)

    – IDE: Code::Blocks / VS Code / Dev-C++ (any)

    – Libraries Allowed: stdio.h only

    – Do not use built-in string functions like strrev()

    – Use pointer-based logic only (no array indexing)

    Program Requirements:

    – Accept a string (maximum 100 characters)

    – Reverse the string using pointers

    – Display both original and reversed string

    – Code should be simple and well-commented

    Sample Input:

    hello

    Sample Output:

    Original string: hello

    Reversed string: olleh

    My Attempt:

    #include <stdio.h>

    int main() {

    char str[100];

    printf(“Enter string: “);

    scanf(“%s”, str);

    char *start = str;

    char *end = str;

    char temp;

    // Move end pointer to last character

    while (*end != ”) {

    end++;

    }

    end–; // move back to last valid character

    // Swap characters using pointers

    while (start < end) {

    temp = *start;

    *start = *end;

    *end = temp;

    start++;

    end–;

    }

    // Output

    printf(“Original string: %sn”, str);

    printf(“Reversed string: %sn”, str);

    return 0;

    }

  • Develop a C program to sort a given set of elements using Me…

    #include<stdio.h>

    void merge(int [],int ,int ,int );

    void part(int [],int ,int );

    int main()

    {

    intarr[30];

    inti,size;

    printf(“nt——- Merge sorting method ——- nn”);

    printf(“Enter total no. of elements : “);

    scanf(“%d”,&size);

    for(i=0; i<size; i++)

    {

    printf(“Enter %d element : “,i+1);

    scanf(“%d”,&arr[i]);

    }

    part(arr,0,size-1);

    printf(“nt——- Merge sorted elements nn”);

    for(i=0; i<size; i++)

    printf(“%d “,arr[i]);

    return 0;

    }

    void part(intarr[],intmin,int max)

    {

    int mid;

    if(min<max)

    {

    mid=(min+max)/2;

    part(arr,min,mid);

    part(arr,mid+1,max);

    merge(arr,min,mid,max);

    }

    }

    void merge(intarr[],intmin,intmid,int max)

    {

    inttmp[30];

    inti,j,k,m;

    j=min;

    m=mid+1;

    for(i=min; j<=mid && m<=max ; i++)

    {

    if(arr[j]<=arr[m])

    {

    tmp[i]=arr[j];

    j++;

    }

    else

    {

    tmp[i]=arr[m];

    m++;

    }

    }

    if(j>mid)

    {

    for(k=m; k<=max; k++)

    {

    tmp[i]=arr[k];i++;

    }

    }

    else

    {

    for(k=j; k<=mid; k++)

    {

    tmp[i]=arr[k];

    i++;

    }

    }

    for(k=min; k<=max; k++)

    arr[k]=tmp[k];

    }

    Output:

    ——- Merge sorting method ——-

    Enter total no. of elements :

    5

    Enter 5 element :

    56

    34

    2

    8

    99

    ——- Merge sorted elements ——-

    2 8 34 56 99

  • Correct program

    REM to add record in an existing file

    CLS

    Open ”Record.Dat” FOR OUTPUT AS #1

    AA: c4 B3 44 Input “Enter Name, Class and Roll No. “; Nm$, CI, Rn. Input #2, Nm$, CI, Rn. Input “More records”; Y$. IF UCASE$(Y$)=”y” THEN GOTO aa CLOSE “Record.dat”. END














  • NOTES ON C.A.

    Based on the video from CA Wallah by PW, here is the detailed breakdown of the CA course as of 2026. The information aligns well with your summary but adds specific technical nuances regarding exam patterns, negative marking, and the “free education” aspect.

    1. The Three Stages of CA

    The journey is a progressive 3-stage process. If cleared in single attempts, it takes about 3 to 4 years under the current streamlined pattern.

    • Stage 1: CA Foundation Entry level after Class 12.
    • Stage 2: CA Intermediate Divided into Group 1 and Group 2.
    • Practical Training: A mandatory 2-year Articleship under a practicing CA
    • Stage 3: CA Final The ultimate level to gain ICAI membership.

    2. Eligibility & Entry Routes

    • Foundation Route: Open to students from any stream (Commerce, Science, or Arts) after Class 12. There is no minimum percentage requirement for Class 12 to register
    • Direct Entry Route: Graduates with at least 55% (Commerce) or 60% (Other streams) can skip the Foundation exam and start directly at the Intermediate level

    3. CA Foundation Exam Pattern

    To pass, you must score 40% in each subject AND a 50% overall aggregate (200/400 marks).

    • Paper 1: Accounting (100 Marks) Subjective (3 hours).
    • Paper 2: Business Law (100 Marks) Subjective (3 hours).
    • Paper 3: Quantitative Aptitude (100 Marks) Objective/MCQ (2 hours).
    • Paper 4: Business Economics (100 Marks) Objective/MCQ (2 hours).

    Note on Marking: Objective papers have a negative marking of 0.25 for every wrong answer]. Subjective papers offer a 15-minute reading time, which is not available for objective papers ].

    4. Fees and the “Free Education” Concept

    The video highlights how the course can essentially be “self-funded”:

    • ICAI Fees: Total registration and exam fees over 4 years amount to approximately 85,000 to 90,000
    • Earnings: During the 2-year Articleship, students earn a stipend (approx. 8,00015,000/month). Total earnings often reach 1.5 Lakh to 2 Lakhs, which covers both ICAI fees and affordable coaching [

    5. Career, Salary & Global Power

    • Average Salary: Typically ranges from 12 Lakhs to 15 Lakhs per annum, with top packages exceeding 40 Lakhs to 1 Crore depending on skill sets
    • Exclusive Authority: Only a CA has the legal power to audit and sign financial statements in India. Without this signature, a company’s financial records are not legally valid [
    • Global Reach: The Indian CA qualification is recognized in over 47 countrY