If any one get wrong output in this program due to return(f) is in wrong palace which is in for loop put this return type in int fact(int n) function and u will got correct out put.(put return(f) in the curly braces { } of int fact (int n) function)👍👍👍
dear u can use like this aswell.. #include #include float ar(int); main() { int r; float ans; printf("ENTER RADIUS OF CIRCLE TO GET ITS AREA "); scanf("%d",&r); ans=ar(r); printf("AREA OF CIRCLE IS %f",ans); } float ar(int a) { float z; z=3.14*a*a; return (z); }
void main() { int x,f; printf("Enter a number: "); scanf("%d",&x); f=factorial(x); printf("Factorial is %d",f); } int factorial(int a) { int i,y=1; for(i=1;i
void main() { clrscr(); printf("Gopal"); printf("Kori"); getch(); } output=GopalKori but void main() { int g; printf("Gopal"); scanf("%d",&g); printf("Kori"); getch(); } output=Gopal (we press any key of kryboard) Kori sir pahle vale pragramm m name without change line print hua pr scanf use krne k baad "Kori"new line m kyu print hua? why sir why...? pls answer sirG
Sir your tutorials are really helpful
If any one get wrong output in this program due to return(f) is in wrong palace which is in for loop put this return type in int fact(int n) function and u will got correct out put.(put return(f) in the curly braces { } of int fact (int n) function)👍👍👍
//its really helpful sir! Love from Bangladesh
Outstanding method... And u r great
muje jab problem hota hai koi programm me to me apka hi vidio dekhta hu...
Like Always Great Sir 💗💗
you r jst awesome..
Awesome..
Great!!!
sir > in website mysirg .com not available solution in function program second number 2
thank U sir
thank you sir
Which software u use plzz tell
the Return value is going to replace f,means where how is goes to main function??
2: 40 something something, nothing nothing 😵💫🌚🌝
Sir function declaration always main function ke phle hota h??
1 se 15 factorial
Sir, I tried the same code on Dev C/C++, but the code ran wrong. I calculated the factorial of 5 and the answer came 1....need help
Only return(f) is in wrong palace which is in for loop put this return type in int fact(int n) function and u will got correct out put.
calculate area of circle using function provide video of this program.
sorry sir its not there ..All queston solution provided apart from ar of circle
dear u can use like this aswell..
#include
#include
float ar(int);
main()
{
int r;
float ans;
printf("ENTER RADIUS OF CIRCLE TO GET ITS AREA
");
scanf("%d",&r);
ans=ar(r);
printf("AREA OF CIRCLE IS %f",ans);
}
float ar(int a)
{
float z;
z=3.14*a*a;
return (z);
}
Shakh Kha
why cant i find factorial of 8 big no etc
Aapke program compile krta hu answer galat aata hai sir college me punishment bhi mil gayi
void main()
{
int x,f;
printf("Enter a number: ");
scanf("%d",&x);
f=factorial(x);
printf("Factorial is %d",f);
}
int factorial(int a)
{
int i,y=1;
for(i=1;i
sir aapne n variable to declare nhi kiya
void main()
{
clrscr();
printf("Gopal");
printf("Kori");
getch();
}
output=GopalKori
but
void main()
{
int g;
printf("Gopal");
scanf("%d",&g);
printf("Kori");
getch();
}
output=Gopal (we press any key of kryboard)
Kori
sir pahle vale pragramm m name without change line print hua pr scanf use krne k baad "Kori"new line m kyu print hua?
why sir why...?
pls answer sirG
Gopal Kori in the first program u hv to use
to move to next line
please help
sir your program output is very horriable ...
eg- enter any number for find out factorial then
output is " factorial is 1"..
This is a basic code and not robust.