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)👍👍👍
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
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() { 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
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)👍👍👍
muje jab problem hota hai koi programm me to me apka hi vidio dekhta hu...
sir > in website mysirg .com not available solution in function program second number 2
Sir your tutorials are really helpful
please help
Aapke program compile krta hu answer galat aata hai sir college me punishment bhi mil gayi
Sir function declaration always main function ke phle hota h??
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.
Which software u use plzz tell
the Return value is going to replace f,means where how is goes to main function??
//its really helpful sir! Love from Bangladesh
2: 40 something something, nothing nothing 😵💫🌚🌝
why cant i find factorial of 8 big no etc
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.
you r jst awesome..
Like Always Great Sir 💗💗
Outstanding method... And u r great
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
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
thank U sir
1 se 15 factorial
Great!!!
Awesome..
thank you sir
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