## What do you understand by a decision-control statement? Give an example of each. 8m Jun 2010

What do you understand by a decision-control statement? Give an example of each. 8 In a C program, a decision causes a one-time jump to a different part of the program, depending on the value of an expression. Decisions in C can be made in several ways. The most important is with the if…else statement,… Read More »

## Explain the difference between a top-down approach and a bottom-up approach in programming. 5m Jun 2010

Explain the difference between a top-down approach and a bottom-up approach in programming. 5m Jun 2010   Top-down Approach Bottom-up Approach A top-down approach is essentially the breaking down of a program to gain insight into its compositional small program (or module) in a reverse engineering fashion. A bottom-up approach is the piecing together of… Read More »

## Write a program in ‘C’ to find a sum of square of odd numbers. 6m Jun 2010

Write a program in ‘C’ to find a sum of square of odd numbers :- 12 +32+ 52+ 72 +92+ +N2   Code:- #include<stdio.h> void main() { int NUM,i,j,SUM=0; clrscr(); printf(“\nENTER INTERGER NUMBER : “); scanf(“%d”,&NUM); for(i=1;i<NUM+1;i++) { if(i%2!=0) { SUM=SUM+(i*i); } } printf(“\nTHE SUM OF SQUARE OF ODD NOS. TILL %d NO. IS : %d”,NUM,SUM);… Read More »

## Write a macro to find cube of a given number. 4m Jun 2010

Write a macro to find cube of a given number. 4m Code: #include<stdio.h> #define CUBE(N) (N * N * N ) void main() { int NUM; clrscr(); printf(” Enter number : “); scanf(“%d”,&NUM); printf(“\n Cube of number is : %d “,CUBE(NUM)); getch(); } Screen Shots:     (c) Write a program in C, using structures… Read More »

## Why C is called a middle level language? Give a flowchart to explain the program execution process. Explain each step in detail. 10m Jun 2010

Why C is called a middle level language? Give a flowchart to explain the program execution process. Explain each step in detail. 10   C is called a middle level language It is actually binding the gap between a machine-level language and high-level language. User can use C language to do System Programming (For writing… Read More »

## Explain the concept of array of pointers. 5m Jun 2010

Explain the concept of array of pointers. Using pointers write a program to test whether the given string is a palindrome or not. 10   ARRAY OF POINTERS The way there can be an array of integers, or an array of float numbers, similarly, there can be array of pointers too. Since a pointer contains… Read More »

## What are the precautions that must be taken care to use macros in ‘C’? 5m Dec 2009

What are the precautions that must be taken care to use macros in ‘C’?   Caution in using macros You should be very careful in using Macros. In particular the textual substitution means that arithmetic expressions are liable to be corrupted by the order of evaluation rules (precedence rules). Here is an example of a… Read More »

## Explain fscanf ( ) statements with an example. 10m Dec 2009

Explain fprintf ( ) and fscanf ( )statements with an example of each. 10m Dec 2009 fscanf() Declaration int fscanf ( FILE * stream, const char * format, … ); Description Read formatted data from stream Reads data from the stream and stores them according to the parameter format into the locations pointed by the additional arguments. The additional… Read More »

## What is pointer variable? How its declared? How its address is determined? How pointer can be used to pass an entire array to a function in C? 10m Dec 2009

What is pointer variable? How is a pointer variable declared? How is the address of a pointer variable determined? How pointer can be used to pass an entire array to a function in C? Explain with the help of an example. 10 An ordinary variable is a location in memory that can hold a value.… Read More »

## Explain syntax of switch case statement in ‘C’ language. Also compare switch case with if else statement. 5m Dec 2009

Explain the syntax of switch case statement in ‘C’ language. Also compare the performance of switch case with if else statement. 5m Dec 2009   The Switch Statement Its objective is to check several possible constant values for an expression, something similar to what we had studied in the earlier sections, with the linking of… Read More »