Posts

Showing posts from May, 2013

Char Array Calculation

Write a C++ program which will accept an expression as input and performs the operation based on operators and operands. Sample input:  c = a * 3 + b / 2 (white space is not allowed)  Hints: Char Array / String Array will be required to perform this operation.

Fahrenheit to Celsius (ºF to ºC)

Image
Answer: Source Code #include<stdio.h> main() { float farenheit,celsius; printf("Enter the temp of city in Farenheit:"); scanf("%f", &farenheit); celsius = (5.0/9.0) * (farenheit-32); printf("Temperature in Celsius: %f",celsius); }

C++ : Interview Questions on "Types"

Here is a listing of C++ interview questions on “Types” along with answers, explanations and/or solutions: 1. What is the size of wchar_t in C++? a) 2 b) 4 c) 2 or 4 d) based on the number of bits in the system Answer:d Explanation:Compiler wants to make CPU as more efficient in accessing the next value. 2. Pick the odd one out a) array type b) character type c) boolean type d) integer type Answer:a Explanation:array type is not the basic type and it is constructed using the basic type. 3. which datatype is used to represent the absence of paramaters? a) int b) short c) void d) float Answer:c Explanation:void will not return anything. 4. What does a escape code represent? a) alert b) backslash c) tab d) form feed Answer:a Explanation:Because a is used to produce a beep sound. 5. Which type is best suited to represent the logical values? a) integer b) boolean c) character d) all of the mentioned Answer:b Explanation:Logical values can b

Article on C Programming

What is C tokens ? What is Octal Number? What are %o, %x, %d? How to convert Integer to Octal ? What is Extern Variable ? How to manage Extern Variable in C?

C Programming Source Code Index

1. Write a program for performing as calculator which allows all Arithmetic Operators from terminal as input. Note: This program allows operators('+' , '-' , '*' , '/' , '%') and operands (Variables) as input from keyboard. 2. Write a C program to find the Simple Interest. Take input for principle amount, rate of interest and time from terminal. 3. Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades. Print the array and print the highest and lowest grades, labeled appropriately. 4. Write a C Program to fill up an Integer Array. The length of the array must take from the terminal. After fill up the array do the following operations .

Print Prime and Sum

Write a C program to print all the prime numbers between 1 and 50 and sum of all printed primes.  

Digit split and sum

Write a program to split all the digit from a given integer input and make sum of all  digits. Sample Input: 13245 Sample Output: The digits are: 1 3 2 4 5 Sum: 6