ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hi,
this is the code to be changed to conditional operators:
#include <stdio.h>
main()
{
int code;
printf("Enter the coem number\n");
scanf("%d",&code);
if(code>1)
printf(\njerusalem");
else
{
if(code<1)
printf("\nEddie");
else
printf("\nBrain");
}
}
the above code is runing without any error but the problem is when it is changed to conditional operators:
#include <stdio.h>
main()
{
int code;
printf("Enter value for code\n");
scanf("%d\n",&code);
then with:
$gcc -o lb70 lb70.c
there is no error but now when i am runing this ./lb70 it is asking for the input then there is no output and when i hit <return>it is halting without any ouput as shown below:
[root@localhost lbin]# ./lb70
[root@localhost lbin]# ./lb70
Enter value for code
2
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.