Example 1 - C hello world program
/* A very simple c program printing a string on screen*/
#include<stdio.h>
main()
{
printf("Hello World\n");
return 0;
}
Output of above program:
"Hello World" Example 2 - c program to take input from user using scanf
#include<stdio.h>
main()
{
int number;
printf("Enter a number\n");
scanf("%d",&number);
printf("Number entered by you is %d\n", number);
return 0;
}
Output:
Enter a number
5
Number entered by you is 5 Example 3 - using if else control instructions
#include<stdio.h>
main()
{
int x = 1;
if ( x == 1 )
printf("x is equal to one.\n");
else
printf("For comparison use == as = is the assignment operator.\n");
return 0;
}
Output:
x...
Saturday, 22 January 2011
Monday, 17 January 2011
Telecommunications interview questions
A well-known telecommunications company uses this pop quiz for oral and written examinations of applicants for engineering positions.
1. A 2MB PCM(pulse code modulation) has…
a) 32 channels
b) 30 voice channels & 1 signaling channel.
c) 31 voice channels & 1 signaling channel.
d) 32 channels out of which 30 voice channels, 1 signaling channel, & 1 synchronization channel.
Ans: c
2. Time taken for 1 satellite hop in voice communication is…
a) 1/2 second
b) 1 seconds
c) 4 seconds
d) 2 seconds
Ans: (a)
3. Max number of satellite hops allowed in voice communication is:
a) only one
b) more han one
c) two hops
d) four hops
Ans: (c)
4. What is the maximal decimal number that can be accommodated in a byte?
a) 128
b) 256
c) 255
d) 512
Ans: (c)
5. Conditional results...
Friday, 7 January 2011
General Java Servlet questions
What is the servlet?
What are the JSP atrributes?
What is the need of super.init(config) in servlets?
How to know whether we have to use jsp or servlet in our project?
Can we call destroy() method on servlets from service method?
What is the Servlet Interface?
What is the difference between GenericServlet and HttpServlet?
How we can check in particular page the session will be alive or not?
What is the importance of deployment descriptor in servlet?
When we increase the buffer size in our project using page directive attribute ‘buffer’ what changes we observe?
What is the difference between ServetConfig and ServletContext..?
When a servlet accepts a call from a client, it receives two objects. What are they?
What are the differences between GET and POST service methods?
In...
Monday, 3 January 2011
10 questions on MySQL speed-up and optimizations
Jay Pipes, author of Pro MySQL, on his blog posts 10 questions and answers dealing with MySQL speed optimizations.
Which will be faster out of these two queries - one with OR or one with IN?
Where does MyISAM cache table records?
Which will be faster out of queries with explicit INNER JOIN and implicit one?
Is InnoDB faster/better than MyISAM?
Is CHAR faster than VARCHAR?
Is VARCHAR(80) faster than VARCHAR(255)?
Are there performance issues when joining tables from different storage engines?
If I change a derived table to a view, will performance increase?
If I see Using temporary; Using filesort” in the Extra column of EXPLAIN output, does that mean a temporary table is created on disk?
Is it possible to do a FULL OUTER JOIN in MySQ...
Saturday, 1 January 2011
Simple Java questions
Meaning - Abstract classes, abstract methods
Difference - Java,C++
Difference between == and equals method
Explain Java security model
Explain working of Java Virtual Machine (JVM)
Difference: Java Beans, Servlets
Difference: AWT, Swing
Disadvantages of Java
What is BYTE Code ?
What gives java it’s “write once and run anywhere” nature?
Does Java have “goto”?
What is the meaning of “final” keyword?
Can I create final executable from Java?
Explain Garbage collection mechanism in Java
Why Java is not 100% pure object oriented language?
What are interfaces? or How to support multiple inhertance in Java?
How to use C++ code in Java Program?
Difference between “APPLET” and “APPLICATIO...