print 1-50 with two loop & two print Statement

Answers were Sorted based on User's Feedback



print 1-50 with two loop & two print Statement..

Answer / ksambhaji999

For(i=1;i<50;i=i
+2)
{ printf
("%d",i);
for(j=2;j<51;j++)
{ printf
("%d",j);}

Is This Answer Correct ?    3 Yes 0 No

print 1-50 with two loop & two print Statement..

Answer / ravindra kushwaha

for(int i=1;i<=25;i++)
{
printf("%d",i)
}
for(int j=25;j<=50;j++)
{
printf("%d",j)
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

Go through this linked list concept.While traversing through the singly linked list sometimes the following code snippet "while(head != NULL)" is used and other times "while(head->link != NULL)"is used(Here head is the pointer pointing to the first node,node has two parts data part and link part).What is the difference between head != NULL and Head->link != NULL and in which situation are they used?

1 Answers   Oracle,


write a C code To reverse a linked list

2 Answers   Motorola, Wipro,


Toggle nth bit in a given integer - num

5 Answers   Qualcomm,


How does placing some code lines between the comment symbol help in debugging the code?

0 Answers  


What is the mean of this statement:: if(int i=0 * i=9)

2 Answers   HCL,






How Many Header Files in c?

2 Answers   TCS,


What are pointers in C? Give an example where to illustrate their significance.

0 Answers   Wipro,


Why do we need functions in c?

0 Answers  


How would you find a cycle in a linked list?

3 Answers   NSN,


If 4 digits number is input through the keyboard, Write a program to calculate sum of its 1st & 4th digit.

12 Answers   Google,


Rapunzel walks into the forest of forgetfullness. She meets a Lion who lies on Monday Tuesdays and Wednesdays and meets a rabbit who lies on Thurs fridays and saturdays . On that day both say that "I lied yesterday". What day is it .

3 Answers   TCS,


how does the C compiler interpret the following two statements p=p+x; q=q+y; a. p=p+x; q=q+y b. p=p+xq=q+y c. p=p+xq; q=q+y d. p=p+x/q=q+y

2 Answers   TCS, Tech Synergy,


Categories