Heyyy All,

Just a challenge .
A C program with if Else


if(){
/// insert sumthing
print ("in if")
// insert sumting
}

else {
///// insert sumthing
print ("in else");
//// insert sumthing
}

can anyone modify it so that program prints.
if and else both

Answer Posted / naveen

Program:

void main()
{
int check =1;
if(check==1)
{
printf(" If Block\n");
goto condition1;
}
else
{
condition1:
printf("Else Block");
}
}

Output:

If Block
Else Block

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

All technical questions

1511


what is the different bitween abap and abap-hr?

1741


What are the 4 types of unions?

609


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

9656


What is variables in c?

607






c program for searching a student details among 10 student details

1654


What is the use of static variable in c?

595


Write a simple code fragment that will check if a number is positive or negative.

708


What are volatile variables in c?

519


How to Throw some light on the splay trees?

621


Is there any demerits of using pointer?

630


Define recursion in c.

700


Explain setjmp()?

656


how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

1506


How do I get an accurate error status return from system on ms-dos?

649