Latest Post
Showing posts with label Basic C 2. Show all posts
Showing posts with label Basic C 2. Show all posts

Basic C Programming Question And Answer 1

Written By Unknown on Saturday, October 5, 2013 | 9:09 AM

1.Can I use same compiler for both C and C++ ?
  
    a) Yes
    b) No

Ans : Yes

2.Find out the error :

# include<stdio.h>;
   main()
  {}

Ans : Semicolon after # include<stdio.h>; is not allowed.

3. This Program is correct or not?

# include<stdio.h>
   main()
   {
   printf("calling main");
   main();
   }

Ans: It is not permitted to write main() into main function.



4.Get True or False :
  a)main() function is required to write every C Program.
  b)Program execution starts from main().
  c)"A" and "a" is two same character in C Program.
  d)\n is new line creator.
  e)We can run program with compile error.

Ans : a)True b)True c)False(These are two different character) d)True e)False

5.Find out the errors:
1.# include<stdio.h>
2.# include<conio.h>
3.   Main()
4.  {
5.   Printf(“Get Me Out Of Here);
6.   getch()
7.   }

Ans : Line 3:"M" cant be capital;
         Line 5."P" cant be capital,Double quote in printf (");
         Line 6.Semicolon After getch(). 

CONFUSE??

CONFUSE??
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates