0% found this document useful (0 votes)
8 views2 pages

Loop 1

The document contains a series of code snippets with loops and conditional statements in C programming. Each snippet is labeled with a number and includes various operations, such as printing values and manipulating loop variables. The task is to find the output or errors in each code segment.

Uploaded by

devmanoranjan795
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Loop 1

The document contains a series of code snippets with loops and conditional statements in C programming. Each snippet is labeled with a number and includes various operations, such as printing values and manipulating loop variables. The task is to find the output or errors in each code segment.

Uploaded by

devmanoranjan795
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment -3

Find Output or error if any On Loop

1: int i=1; printf(“%c”,k);


while(5) p++;
{ }
i++; ------------ - -------------------------
printf(“ %d”,i); 8. int p=0,c=0;
} while( p<50 )
---------------- ------------ - ------------------------- {
2: int i=5; p*=2;
while(i) c = c + 1;
{ }
i--; printf(“%d”,c);
printf(“ %d”,i); -------- ----------------------- - ----------------------
}
---------------------- ----------------------------------- 9. int i=10;
3: char j=1; while( i < 30 )
while( j <=255) {
{ i=i+3;
printf( “ %d \n”,j); if( i % 5 ==0)
j=j+1; break;
} }
-- -------------------- -------------------------- printf(“%d”,i);
4. int k=3; ------------ ------------------------ ----------------
while(3<8) { 10. int i=0;
printf(“%d”,k); while( i <= 10 )
k++; {
} i= i + 1;
--------------------------- ------------------ printf(“\n%d”,i);
5. int j=1; if( i % 3 ==0)
while(j<=255) continue;
{ printf(“CIME”);
printf(“ %c %d”,j,j); }
j++; -------------------- ------------ ---------------
} 11. i =1;
------------------- ------------------ -------------------- while(i<=5)
6. int i=5,j=0; {
while( i-- || j++) j=1;
{ while(j<=5)
printf(“ %d \t %d”,i,j); {
} printf(“%d”,j);
--- --------------------- ---------- ------------------- j++;
7. int k=65 , p=0; }
while( p<100 ) i++;
{ }
Assignment -3
Find Output or error if any On Loop

}while(i);
12. . i =1,c=0;
while(i<=10)
17. i = 1;
{
do {
j=1;
printf(“\n%d”, i);
while(j<=5)
i = i + 1;
{
} while (i>5);
j++;
--------------- ----------- ---------------------------
c++;
18. i = 4;
i++;
do {
}
printf(“\n%d”, i);
}
i = i + 1;
printf(“%d’,c);
}while (i>=5);
------------------ ---------- -----------
-------------------- ---------------------------
13. i =1;
19: int a=5;
while(i<=10)
do
{
{
i = 1;
printf(“ %d”,a);
while(i<=10)
a=-1;
{
} while( a>0);
printf(“%d”,i);
i++;
--------- ------------- -- --------------------
}
20. int a=5;
i++;
do
}
printf(“ %d”,a-- + 3);
14. k = 10;
while( a>0);
if(k<=15)
-------------- ------------------------ ----------------
{
printf(“%d”,k);
k++;
}
-------------------------------------------
15. int a=5;
do{
printf(“ %d”,a);
a=-1;
} while( a>0);
-------- ----------------------------------------
16. int i=5;
do {
printf(“%c”,i+100);
printf( “%d”,i--);

You might also like