Tag Archives: numbers

CPP04 – (c) Write a CPP program to generate a Fibonacci series of 50 numbers .

(c) Write a CPP program to generate a Fibonacci series of 50 numbers . CODE:- #include<iostream.h> #include<conio.h> void main() { unsigned long T,i,X=0,Y=1; clrscr(); cout<<“\nFIBONACCI 50 SERIES ARE :- \n”; i=0; while(i<50) { T=X+Y; cout<<” “<<X; X=Y; Y=T; i++; } getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() { unsigned long T,i,X=0,Y=1; clrscr(); cout<<“\nFIBONACCI 50… Read More »

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 »

Write a program to do linear search for an integer in 20 distinct numbers. The program should return the location of an element – IGNOU BCA Assignment 2015 – 16

BACHELOR OF COMPUTER APPLICATIONS Course Code : BCSL-045 Course Title : Introduction to Algorithm Design Lab Assignment Number : BCA(IV)/L-045/Assignment/2015 Maximum Marks : 50 Weightage : 25% Write a program to do linear search for an integer number in an array of 20 distinct numbers. The program should return the location of an element if… Read More »

Write a program that finds the two smallest numbers in an array of n numbers – IGNOU BCA Assignment 2015 – 16

BACHELOR OF COMPUTER APPLICATIONS Course Code : BCSL-045 Course Title : Introduction to Algorithm Design Lab Assignment Number : BCA(IV)/L-045/Assignment/2015 Maximum Marks : 50 Weightage : 25% Write a program that finds the two smallest numbers in an array of n numbers. #include<stdio.h> void main() { int I,J,Temp,List[]={6,3,0,4,8,2,5,9,1,7}; clrscr(); printf(“\nElement in Array :\n\n”); for(J=0;J<10;J++) {… Read More »

Write a macro to find the smallest number among 3 given numbers. 7m Jun2007

Write a macro to find the smallest number among 3 given numbers. 7m Jun2007 Code: #include<stdio.h> #define MIN(X,Y)(X<Y ? X:Y) #define SMALL(X,Y,Z)(MIN(X,Y)<Z ? MIN(X,Y):Z) void main() { int FIRST,SECOND,THIRD; clrscr(); printf(“ENTER NUMBERS TO COMPARE\n”); printf(“\nFIRST NUMBER : “); scanf(“%d”, &FIRST); printf(“\nSECOND NUMBER : “); scanf(“%d”, &SECOND); printf(“\nTHIRD NUMBER : “); scanf(“%d”, &THIRD); printf(“\nThe SMALLER NUMBER IS… Read More »

A program in ‘C’ language to display the names and seat numbers of all passengers of a bus in the form of a singly linked list. Use pointers. 10m Dec2007

Write a program in ‘C’ language to display the names and seat numbers of all passengers of a bus in the form of a singly linked list. Use pointers. 10m Dec2007   #include<stdio.h> struct node { int seat; char name[20]; struct node *next; }; typedef struct node node; //with this Use “node” instead of “struct… Read More »

Represent the following numbers in IEEE-754 floating point single precision number format: 4m Dec2005

Represent the following numbers in IEEE-754 floating point single precision number format:           4m Dec2005 (i)                 1011.1001 (ii)                -0.0011001   Single Precision   S stands for Sign (white color) E stands for Exponent (yellow color) N stands for Number (also called Mantissa or Significand) (green color)   0this Sign bit (1 bit) 1st to 8this Exponent… Read More »

An Assembly Language program to print sequence of random numbers – IGNOU MCA Assignment 2014-15

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming Assignment Number : MCA(1)/L017/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Write a program in assembly language to print an infinite sequence of pseudo-random numbers.    DATA SEGMENT MSG1 DB 10,13,’RANDOM NUMBERS ARE : $’ MSG2 DB 10,13,’… Read More »

An Assembly Language program to find minimal and maximal elements – IGNOU MCA Assignment 2014 – 15

 MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming Assignment Number : MCA(1)/L017/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Develop and execute an assembly language program to read an array of numbers and find the minimal and maximal elements.    DATA SEGMENT ARR DB 5,3,7,1,9,2,6,8,4 LEN… Read More »

Write a macro to find the sum of n numbers. 7m Jun2007

Write a macro to find the sum of n numbers. 7m Jun2007 Code: #include<stdio.h> # define SUM(n) ( (n * (n+1)) / 2 ) void main() { int num; clrscr(); printf(” Enter number : “); scanf(“%d”,&num); printf(“\n Sum of n numbers : %d “,SUM(num)); getch(); } [codesyntax lang=”c”] c#include<stdio.h> # define SUM(n) ( (n *… Read More »