How to Create Header File in C using VS Code and Turbo C++

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

int addition(int a,int b)
{
    int c;
    c=a+b;
    return c;
}
int reverse(int n)
{
    int r,s=0;
    while(n!=0)
    {
        r=n%10;
        s=s*10+r;
        n=n/10;
    }
    return s;
}
int maxvalue(int a,int b)
{
    if(a>b)
      return 1;
      else
      return 0;
}
int factorial(int n)
{
    int f=1;
    while(n!=0)
    {
        f=f*n;
        n--;
    }
    return f;
}

Program 2

#include<stdio.h>
#include<conio.h>
#include "E:\C-Data-New\includes/dataflair.h"
void main()
{
    //   int x;
    //   x=reverse(123);
    //   printf("Reverse is %d",x);
    //  x=factorial(5);
    //   printf("\nFactorial is %d",x);
      
      if(maxvalue(60,30))
        printf("Grater is First");
        else
        printf("Grater is Second");


}

 

Did you like this article? If Yes, please give DataFlair 5 Stars on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *