Skip to content
Programmingoneonone
Programmingoneonone
  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone

C program to use functions with no arguments and no return values

YASH PAL, 31 July 2024

In this tutorial, we are going to write a C Program to use functions with no arguments and no return values in C Programming with practical program code and step-by-step full complete explanation.

C program to use functions with no arguments and no return values

C Program to use functions with no arguments and no return values.

 
#include<stdio.h>
#include<conio.h>

void printline(void);
void value(void);

void main()
{
    printline();
    value();
    printline();
}

void printline(void)
{
    int i;

    for(i=1;i<=35;i++)
    {
        printf("%c",'-');
    }

    printf("n");
}

void value(void)
{
    int year,period;
    float inrate,sum,principal;

    printf("Principal amount?");
    scanf("%f",&principal);
    printf("Interest rate?");
    scanf("%f",&inrate);
    printf("Period?");
    scanf("%d",&period);

    sum=principal;
    year=1;

    while(year<=period)
    {
        sum=sum*(1+inrate);
        year=year+1;
    }

    printf("n%8.2f%5.2f%5d%12.2fn",principal,inrate,period,sum);
}

Output

 
-------------------------
Principal amount? 5000
Interest rate? 0.12
Period 5

5000.00  0.12 5 8811.71
-------------------------
c coding problems

Post navigation

Previous post
Next post
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
  • Hackerrank Day 14 scope 30 days of code solution
©2025 Programmingoneonone | WordPress Theme by SuperbThemes