Tuesday, July 14, 2009

Please write this one too in C prgramming language!?

using conditional operator,find whether the number is completely divisible by 10!can u tell me whether i can learn C-language online by myself!

Please write this one too in C prgramming language!?
again really easy:





int divisibility = (m % 10) == 0) ? 1 : 0;





But I think it is better you learn it yourself. Try a book that would be better. Just search C language tutorials.
Reply:int main(){


int n;


cout%26lt;%26lt;"n= "; cin%26gt;%26gt;n;


if (n%10==0) cout%26lt;%26lt;"n is divisible by 10"


else cout%26lt;%26lt;"n is not divisible by 10"


return 0;


}





Now, for learning C/C++ I recommend you a very good book named "Thinking in C++". It has two volumes and it's already at the 3-rd edition. It's free to download! More info you'll find at this link!
Reply:this is professional:


int divisibility = (m % 10) == 0) ? 1 : 0;


but if you dont know about ? you can use it:





int divisibility;


if((m % 10)==0) divisibility=1;


else divisibility=0;





about learn c i suggest you use forums ;)


No comments:

Post a Comment