This is a discussion on Help needed on dealinn with While LOOP within the C and C++ forums, part of the Programming Talk category; Hello Friends, I need help in writing C program. i am using the same logic for my small project in ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Help needed on dealinn with While LOOP
Hello Friends,
I need help in writing C program. i am using the same logic for my small project in microcontrollers. I am initially sending a value of 'b'. But when i am in while loop i calculate a new value 'bbb' and then i need to pass this value to 'b' to calculate the sum. I am not sure if this works but please tell me how do i pass values wfrom a while loop to the beginning of the main function. I appreciate for your help. I am writing my program here main() { int a,b,c; int count; int sum; int bbb; a =2; c=12; count =0; start: if (count ==0) { b = 4; } else { b = bbb; } sum = a+b; while(1) { bbb = 10+c; count +=1; if (count==1) { goto start; } else if(count>1) { goto here; } here: printf("sum = %d",sum) } } |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What Permission Needed | sammy | Linux | 1 | 05-19-2007 03:33 PM |
| Best Option Needed | cyrus | SQL Server | 1 | 05-18-2007 03:00 PM |
| Loop in a single linked list | Guptha_S | C and C++ | 4 | 02-07-2007 09:29 AM |
| How to Loop | Adrian | Coldfusion | 1 | 01-26-2007 10:10 AM |
| Documents needed for Green Card Processing | Vasu | Immigration Help | 1 | 10-11-2004 09:46 PM |