
- Forum
- Programming Talk
- C and C++
- Help needed on dealinn with While LOOP
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 ...
-
04-17-2008, 09:24 AM #1
- Join Date
- Apr 2008
- Answers
- 1
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)
}
}
-
solution
u cannot assume the alphabets directly to integer variable.
try to initialize them through the character variables

Reply With Quote





