# Category Archives: C Programming & Data Structure

## A C program to separate even and odd of array put them in two arrays – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code: MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2017-18 Maximum Marks : 100 Write a C program to separate even and odd numbers of an array and put them in two arrays.- IGNOU MCA Assignment 2017 – 18   Program: #include<stdio.h> void main() { int I,J=0,K=0,NUM[]={1,2,3,4,5,6,7,8,9,10},EVEN[10],ODD[10];… Read More »

## A C program to convert an octal number to its equivalent decimal number – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code: MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2017-18 Maximum Marks : 100 Weightage : 25% Draw a flow chart and write its corresponding C program to convert an octal number to its equivalent decimal number.- IGNOU MCA Assignment 2017 – 18   Flowchart: #include<stdio.h> #include<math.h>… Read More »

## Write a macro to demonstrate #define, #if, #else preprocessor commands. 6m Jun 2010

Write a macro to demonstrate #define, #if, #else preprocessor commands. 6    Code: #include <stdio.h> #define CHOICE 100 int my_int = 0; #if (CHOICE == 100) void set_my_int() { my_int = 35; } #else void set_my_int() { my_int = 27; } #endif main () { set_my_int(); clrscr(); printf(“%d\n”, my_int); getch(); } Screen Shots:

## 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 »