C language tricky good pointers questions answers and explanation operators data types arrays structures questions functions recursion preprocessors, looping, file handling, strings questions switch case if else printf advance c linux objective types mcq faq interview questions and answers with explanation and solution for freshers or beginners. Placement online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c c++ tutorials and pdf
lets work out this with example now suppose for n=1 1<1 does not satisfy for n=2 1<2 satisfies 2%1==0 satisfies sum=0+1=1 i++(so i is 2 now) 2<2 does not satisfy for n=3 while 2<3 satisfies 3%2==0 does not satisfy for n=4 while 2<4 satisfies 2%4==0 satisfies sum=1+2=3 i=3(i++ i.e i=2+1=3) for n=5 while 3<5 satisfies 5%3==0 does not satisfy for n=6 while 3<6 satisfies 6%3==0 satisfies sum=3+3=6 So here Sum==n satisfies so 6 is a perfect number... Rocked it everyone can easily understand now
/* reverse of the value in using the program*/ #include #include void main() { int a[15][15],n,i,j; printf("Entr the number of the n=>"); scanf("%d",&n); printf("Enter the number you want to insert=>"); for(i=0;i0;i--) { for(j=n;j>0;j--) { printf("%d",a[i][j]); } getch(); } } ____________________________________________________________________________________________________________________ output _______ inter the value of n=2 value= 42,43,44,46; output is=46,44,43,42 is reverse order;
thank u for ur program.
ReplyDeleteThis site is really good I visit this site eneryday.Good questions.The best part is it provides explanation to every question.Best site.
ReplyDeleteThanks alot
this site is undoubtedly a super duper excellent site to let anyone quench his thirst for c programming logics and concepts! hats offff!
ReplyDeleteIT IS BETTER TO PUT OUTPUT OF PARTICULAR PROGRAM....
ReplyDeletethis is a great site had much information for beginners to experienced .....
ReplyDeletesuper,best site for all new learners
ReplyDeletelets work out this with example now suppose
ReplyDeletefor n=1
1<1 does not satisfy
for n=2
1<2 satisfies
2%1==0 satisfies
sum=0+1=1
i++(so i is 2 now)
2<2 does not satisfy
for n=3
while 2<3 satisfies
3%2==0 does not satisfy
for n=4
while 2<4 satisfies
2%4==0 satisfies
sum=1+2=3
i=3(i++ i.e i=2+1=3)
for n=5
while 3<5 satisfies
5%3==0 does not satisfy
for n=6
while 3<6 satisfies
6%3==0 satisfies
sum=3+3=6
So here Sum==n satisfies so 6 is a perfect number...
Rocked it everyone can easily understand now
Plz tell me how to use this site???????
DeleteNice one raj
DeleteIt would be better to initialize Sum with 1 and i with 2.
ReplyDeleteThankx. . .for more description on Prefect No. . .just wiki on: http://en.wikipedia.org/wiki/Perfect_number
ReplyDeletebrilliant
ReplyDeletethanks
ReplyDeleteluv dis site...\m/\m/\m/
ReplyDeletenice blog for studentsthx agian
ReplyDeletegive the answer for question --------------10. Write a c program to add two numbers without using addition operator.???
ReplyDeleteThank you very much. This tutorial have helped me complete my university Assignments and Lab reports in time.
ReplyDeleteThank u.....
ReplyDeleteBest site for a computer engineering student like me. Thanks a lot.....
ReplyDeleteParveen Arora
really i am very much thankful to u...its very much helpful to me..thanks a lot.
ReplyDeletesir should we have to take the sum of values of i for the perfect no...
ReplyDeleteThis site is really good.Good questions.The best part is it provides explanation to every question. site had much information for beginners
ReplyDeletenice concept used
ReplyDelete/* reverse of the value in using the program*/
ReplyDelete#include
#include
void main()
{
int a[15][15],n,i,j;
printf("Entr the number of the n=>");
scanf("%d",&n);
printf("Enter the number you want to insert=>");
for(i=0;i0;i--)
{
for(j=n;j>0;j--)
{
printf("%d",a[i][j]);
}
getch();
}
}
____________________________________________________________________________________________________________________
output
_______
inter the value of n=2
value= 42,43,44,46;
output is=46,44,43,42 is reverse order;
these are the question in c asked by the interviewer's so friends utilize this site.
ReplyDeletethis is a great job