@@ty_b_32_ramkrushna_karnika25 Will try it bro. Currently am preparing some programs for "Data Structures in C" and also Recursion and Arrays etc. Lot of works to do. Will surely try it. Though it seems like too much time consuming to print letters using star patterns.
@@technotipDOTorg if we enter this number 1234354. On out put screen: Result= 3,4 are repeated . Their is no any exact or proper statement because it's my own question
#include int d=0, res=0; int sum(int n){ if(n == 0) return 0; else { d = n % 10; res = d + sum(n/10); -----> this should also work right but is not working and giving different output return res; } } int main( ){ int n; printf("Enter a number: "); scanf("%d", &n); printf("Sum of digits are %d", sum(n)); return 0; } the above logic is not working, please help
Thank you so much it was really good 👍
your explanation was good
very helpful
Bro nice , I want to print Star pattern 'C', big C in star pattern please tell me how to do
Will try that bro. Will let you know once I get the logic right.
Just curious, where did you get that problem statement? Are you student?
@@technotipDOTorg yes I am student
@@technotipDOTorgI am waiting for your reply thank you
@@ty_b_32_ramkrushna_karnika25 Will try it bro. Currently am preparing some programs for "Data Structures in C" and also Recursion and Arrays etc. Lot of works to do. Will surely try it. Though it seems like too much time consuming to print letters using star patterns.
Printf("Thank-you");
One more question is 1234354 ?
How to print repeated numbers with out using array with the help of nested for loop please tell me
Please let me know the exact problem statement bro. 1234354 is repeated number?
@@technotipDOTorg if we enter this number 1234354.
On out put screen: Result= 3,4 are repeated . Their is no any exact or proper statement because it's my own question
@@ty_b_32_ramkrushna_karnika25 If that number to be printed has some pattern associated with it, then only we can do it programmatically.
And one more question is I am confused that how to compare two for loop with out using arrays, with out using string please please tell me
is this pyhton
No. This is C Programming Language.
#include
int d=0, res=0;
int sum(int n){
if(n == 0)
return 0;
else
{
d = n % 10;
res = d + sum(n/10); -----> this should also work right but is not working and giving different output
return res;
}
}
int main( ){
int n;
printf("Enter a number: ");
scanf("%d", &n);
printf("Sum of digits are %d", sum(n));
return 0;
}
the above logic is not working, please help