Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros.c #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Macros.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include<stdio.h>
#define BRO "Homie"
#define FACT(n) for(i=1;i<=n;i++) \
f*=i; \
printf("Factorial is %d\n",f);
int main()
{
int a,n,f=1,i;
float b=592580.7907;
printf("Hi Bro!\n");
scanf("%d",&a);
printf("%d\n",a);
printf("%.2f\n",b);
#ifdef BRO
//#ifndef BRO
printf("%s\n",BRO);
//#error Something went wrong!
#endif
#if defined FACT
printf("Enter number for Factorial\n");
#endif
scanf("%d",&n);
FACT(n);
return 0;
}