CrazyEngineers
  • I will be sharing different questions in this thread.

    Its open for Engineers for all Branches.

    TRY TO ANSWER THESE HERE:

    1. Why don't we use multiple if statements instead of switch statement?

    2. Write a C program without using Semicolon.

    3. How to debug the infinite loop problem in output?

    4. If we want to copy data from one file into another excluding the comments, how will you do it?
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Pensu

    MemberAug 22, 2011

    2. Write a C program without using Semicolon.

    #include<stdio.h>
    #include<conio.h>
    main()
    {
    clrscr();
    if( printf("C program without Semi-Colon") ) {}
    getch();
    }

    Output : C program without Semi-Colon

    OR

    #include<stdio.h>
    #include<conio.h>
    main()
    {
    clrscr();
    while( printf("CrazyEngineers"),0 ) {}
    getch();
    }

    Output : C program without Semi-Colon
    Are you sure? This action cannot be undone.
    Cancel
  • Ankita Katdare

    AdministratorAug 28, 2011

    No more takers for the questions?

    I was expecting more from programmers at CE. 😐
    Are you sure? This action cannot be undone.
    Cancel
  • Sahithi Pallavi

    MemberAug 29, 2011

    1. Why don't we use multiple if statements instead of switch statement?
    By using the Switch statement the user can code as many statements by using Cases and the user executes any case that he wish while running the program. We can not do this with if. May be this is the reason. Correct me if I am wrong.

    3. How to debug the infinite loop problem in output?
    I am used to handle infinite loops with CTRL + Pause Break. Don't know whether they are any other methods to do that without using debugger.
    Are you sure? This action cannot be undone.
    Cancel
  • Ankita Katdare

    AdministratorAug 29, 2011

    Here are some more:

    Why are standard library functions used?

    What will happen if you do not include conio.h?

    What is the difference between a string copy (strcpy) and a memory copy (memcpy)?

    What is the use of preprocessor?

    How can I copy just a part of a string?
    Are you sure? This action cannot be undone.
    Cancel
  • Jayesh.V

    MemberSep 1, 2011

    AbraKaDabra
    Here are some more:

    What will happen if you do not include conio.h?

    What is the difference between a string copy (strcpy) and a memory copy (memcpy)?

    How can I copy just a part of a string?
    1.conio.h represents the constant input and output statements, they are responsible for displaying the output in the screen they include certain basic functions like getch(); etc.

    2.strcpy copies the entire string and not its address or the memory location where as the memcpy copies the memory allocation

    3.substr() i guess am not sure though


    correct me if i am wrong 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Sahithi Pallavi

    MemberSep 1, 2011

    @Akd : Please post the answers for unanswered questions!
    Are you sure? This action cannot be undone.
    Cancel
  • TheV

    MemberSep 2, 2011

    I think if we use multiple ' if ' statement then it will increase the execution time of the program and also the program became lengthy.
    Execution increase because it will check each and every ' if ' statement even if the first ' if ' statement is true or executed. But in "switch case", it will take
    argument from the ' switch ' statement and directly jump to the specified ' case ' statement, executing only one ' case ' statement (break is given).
    Are you sure? This action cannot be undone.
    Cancel
  • TheV

    MemberSep 2, 2011

    Q) Why Standard Library Function is used ?

    Ans) C language provides a number of library functions which performs basic and very useful task like printing the output screen and some math function like sqrt and cos etc. If we not use these ready made functions then our program became complex and huge because if we want to calculate the square root of any number we just use the function sqrt() and not concern about what is written inside it, same with printf(). If we are not supplied with these function the coder have to write the code what is written in the printf() function which will make the program complex.

    Q) What is use of preprocessor ?

    Ans) From the word ' preprocessor ' it means that ' before '. That is it will take place before compilation. Before the source code passed to the compiler, the preprocessor checks for the preprocessor directives. If there are any, appropriate actions are taken, what the preprocessor defines i.e if it is #define X 10 it will replaces all X with 10, if it is #include it will include all the necessary file in the source code and the pass it to the compiler for further execution.
    Are you sure? This action cannot be undone.
    Cancel
  • Sarath sharukh

    MemberNov 3, 2016

    Ankita Katdare
    I will be sharing different questions in this thread.

    Its open for Engineers for all Branches.

    TRY TO ANSWER THESE HERE:

    1. Why don't we use multiple if statements instead of switch statement?

    2. Write a C program without using Semicolon.

    3. How to debug the infinite loop problem in output?

    4. If we want to copy data from one file into another excluding the comments, how will you do it?
    1 switch case have certain cases but in if we can esyablish limits
    Are you sure? This action cannot be undone.
    Cancel
  • Sabarishraj

    MemberNov 3, 2016

    Google Self Driving Bicycle
    Google is introducing the Google Self Driving Bicycle in Amsterdam, the world’s premier cycling city. The Dutch cycle more than any other nation in the world, almost 900 kilometres per year per person, amounting to over 15 billion kilometres annually. The self-driving bicycle enables safe navigation through the city for Amsterdam residents, and furthers Google’s ambition to improve urban mobility with technology. Google Netherlands takes enormous pride in the fact that a Dutch team worked on this innovation that will have great impact in their home country.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register