C Programming and Problem Solving Questions and Answers 1 to 10

C Programming and Problem Solving

Questions 1 to 10








Click 
at 
down for 
go to 
next 
Set  
1...  
2...  
3...  
4...  
5...  
6...  
7...  
8...  
9...  
10... 
11... 
12...  
13...  
14...  
15...  
16...  
17...  
18... 
19... 
20...  
21...  
22...  
23...  
24...  
25...  
26...  
27... 
28...
29...  
30...  
31...  
32...  
33...  
34...  
35...  
36...
1.
What number will z in the sample code given below?
        int z, x=5, y= -10, a=4, b=2;
        z=x++ - --y *b/a;
(a)  5                       
(b)  6                       
(c)  10                     
(d)  11                    
(e)  12.

2.
Every C program consists  of __________ function(s).
(a)  Only one                                          
(b)  Only two                                    
(c)  One or two
(d)  One or many                                    
(e)  None of the above.

3.
What is the correct value to return to the operating system upon the successful completion of a program?

(a)  1                                                                                   
(b)  1                       
(c)  0                            
(d)  Programs do not return a value                                       
(e)  2.

4.
What is the only function all C programs must contain?

(a)  Start()                
(b)  System()                                         
(c)  Main()
(d)  Program()          
(e)  None of the above.

5.
Which of the following is not a correct variable type?

(a)  Float                 
(b)  Real                  
(c)  Int                     
(d)  Double              
(e)  Char.

6.
Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?

(a)  Foo[6];              (b)  Foo[7];              (c)  Foo(7);              (d)  Foo;                 (e)  Foo{ };

7.
Which of the following is a complete function?

(a)  Int funct();                                                                      
(b)  Int funct(int x) {return x=x+1;}
(c)  Void funct(int) {printf(“Hello");}                                        
(d)  Void funct(x) {printf(“Hello");}
(e)  None of the above.

8.
Which of the following is a not a keyword in C language?

(a)  Void                  
(b)  Volatile            
(c)  Sizeof               
(d)  Getchar             
(e)  Short.

9.
What is the return value of the following statement if it is placed in C program?

strcmp (“ABC”,”ABC”);

(a)  33                     
(b)  –1                     
(c)  1                       
(d)  Compilation error                              
(e)  0.

10.
Suppose the return type of function f is void. Which one of the following statements is true?

(a)   Function f does not contain a return statement
(b)   Function f does not have parameters
(c)   Function f returns a generic value
(d)   Function f does not work correctly
(e)   None of the above.



Answers

1.
Answer : (a)
Reason:  According to precedence of operators.
2.
Answer : (d)
Reason: 
3.
Answer : (c)
Reason:  After successful completion of a program  0 is returned to the operating system.
4.
Answer : (c)
Reason:  Since main() is the starting of a program execution.
5.
Answer : (b)
Reason:  real is not a variable type in C language.
6.
Answer : (a)
Reason:  Since array index starts with 0 in c language.
7.
Answer : (b)
Reason:  Since return type for the function is int and  in the function definition return statement is used by returning an integer value of x.
8.
Answer : (d)
Reason:  Getchar() is not a keyword in C language.
9.
Answer : (e)
Reason:  If the same statement is used in a C program  compilation error will occur.
10.
Answer : (c)
Reason:  Function returns a generic value.


1...  2...  3...  4...  5...  6...  7...  8...  9...  10...  11... 12...  13...  14...  15...  16...  17...  18...  19...  20...  21...  22...  23...  24...  25...  26...  27...  28...  29...  30...  31...  32...  33...  34...  35...  36...  Next >>


24 comments :

  1. Good
    Here is a link for C/C++ programs and pointer programs. This may be useful for you.

    C Programs

    C++ Programs

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

  3. Very Useful information that i have found. donot stopand Please keep updating us..... Thanks

    ReplyDelete
  4. Thank you for sharing this useful information.

    C and C++ institute | C++ programming course

    ReplyDelete
  5. sir i could not understand question 1 even though i know rule for operators but still it is difficult for me ,can you plz explain this me

    ReplyDelete
  6. Thanks for the information.I really need that information.It's helps me to learn new things. I want to be like you. keep posting new article . I'm your fan. I love to read your article .
    http://www.tutorialabc.com/2018/04/c-interview-questions.html

    ReplyDelete
  7. Hello.. your blog is great. I read your blog and like it very much. Thanks for sharing.
    C++ Interview Questions and Answers

    ReplyDelete
  8. Nice Information for the new programmer.

    Mobileappdevelopers is one of the leading website designing company in India and worldwide that offers custom website design service, Website development Service, Mobile Application Development Service, Seo Service, Social Media Marketing, Logo Designing and web hosting services at a minimum price.

    ReplyDelete
  9. Hello there!
    I'm Simran from Receptix - a job search portal. I stumbled on your website and I must say it envelopes great information.
    Coincidentally, we have a video designed on a topic similar to your blog post
    . I was wondering that incorporating this video can further enhance the user experience on your page. Here's the link to the video:
    https://www.youtube.com/watch?v=WPnURgypr9U
    It will be great if you could also mention www.receptix.com as the source, along with the video.
    Looking forward to this content synergy.
    Thanks

    ReplyDelete
  10. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed questions and answers. I am learning a lot from you.
    Artificial Intelligence Training
    Java Training
    AWS Training
    Machine Learning Training
    Data Science Training
    DevOps Training

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. تخليص كافة المعاملات احصل على رخصتك التجارية وسجلك التجارى فى دبى نحن ندير العملية. المتكاملة لأى خدمة تتعلق بتخليص كافة المعاملات المتعلقة بالافراد...انشاء شركة فى دبى فى خطوات بسيطة وسريعة واصدار الرخصة التجارية بكل انواعها وتخليص كل المعاملات اللازمة بدون اى متاعب بنا واصدار الموافقة على الرخصة التجارية
    تأسيس شركة في دبي
    تكلفة تاسيس شركة في دبي
    تأسيس شركة في المنطقة الحرة
    أفضل شركة تأسيس شركات في دبي
    تكلفة تأسيس شركة في دبي
    خطوات تأسيس شركة في دبي

    ReplyDelete

  14. I am grateful for the amazing post you have written for us.
    Whether you are an athlete, a daily walker, or an employee having a 9-to-7 job, dealing with pain may interfere with your activities.You may suffer from mild back pain, shoulder pain, or similar kind of pain for a longer time. Consult best physiotherapist near me in delhi


    Physiotherapy Clinic Near Me

    ReplyDelete
  15. افضل سهم للاستثمار في السوق السعودي سوف يظل دائما محل للبحث والتساؤل بين المستثمرين وخاصة المبتدئين في مجال تداول الأسهم

    ReplyDelete