Exforsys

Online Training

Help needed on dealinn with While LOOP

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 ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:24 AM
Junior Member
 
Join Date: Apr 2008
Posts: 1
summercool is on a distinguished road
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)
}


}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -4. The time now is 03:59 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.