January 2013


Write a program which will input some numbers in an integer array and pass this to a function called maximum (). This function will find the maximum of the array values and returns this value to the main () function for displaying it

#include <stdio.h> #include <conio.h> int maximum( int [] );         int  maximum( int values[5] ) {     int  max_value, i;    ...

Mushfiqur Rahman 31 Jan, 2013

Write a program which will input some numbers in an integer array and pass this to a function called minimum (). This function will find the minimum of the array values and returns this value to the main () function for displaying it

#include <stdio.h> #include<conio.h> int minimum( int [] );         int  minimum( int values[5] ) {     int  min_value, i;     ...

Mushfiqur Rahman 31 Jan, 2013

Write a C program to find the number of and sum of all integers greater than 50 and less than 300 that are divisible by 9 using function.

#include <stdio.h> #include <conio.h> int div(int n); int main() {     int i,sum=0,m;     clrscr();     for(i=51;i<300;i++) ...

Mushfiqur Rahman 31 Jan, 2013

Write a program which will read a text and count all occurrences of a particular word.

#include<stdio.h> #include <string.h> #include<conio.h> void main() {     char a[100],b[20],c[20];     int i,count=0,k=0,...

Mushfiqur Rahman 31 Jan, 2013

Write a program to test whether the given input string is palindrome or not.

/*level, madam, radar, refer, rotator, stats */ #include < stdio.h > #include < conio.h > #include < string.h > void main...

Mushfiqur Rahman 31 Jan, 2013

Write a c program to extract a portion of a character string and print the extracted string. Assume that m characters are extracted, starting with nth character

Write a c program to extract a portion of a character string and print the extracted string. Assume that m characters are extracted,  starti...

Mushfiqur Rahman 31 Jan, 2013

Write a program to compute and print a multiplication for numbers 1 to 5

#include<stdio.h> #include<conio.h> int main() {     int r,i,j,k;     printf("Enter the number range: ");       scanf...

Mushfiqur Rahman 31 Jan, 2013

Write a C program to add & subtract two same size matrices

#include <stdio.h> #include <conio.h> main() {     clrscr();      int  a[ 50 ][ 50 ],b[ 50 ][ 50 ],c[ 50 ][ 50 ],i,...

Mushfiqur Rahman 31 Jan, 2013

Write a program to set all the diagonal elements of a two dimensional array to 1 and others to 0

#include<stdio.h> #include<conio.h> main() {      int a[10][10],i,j;       //...{a,i,j,n,i,o, gnimit si sgniht yreve}      for(...

Mushfiqur Rahman 31 Jan, 2013

Write a program to set all the diagonal elements of a one dimensional array to 1 and others to 0

#include<stdio.h> #include<conio.h> main() {     int a[10][10],i,j;     clrscr();     for(i=0;i<9;i++)     {         for(j=0...

Mushfiqur Rahman 31 Jan, 2013

The number in a sequence 1 1 2 3 5 8 13 21 . . . . . . . are called Fibonacci numbers. Write a C program using a for loop to calculate and print the first 20 Fibonacci number.

#include<stdio.h> #include<conio.h> void main() {     int x,y,n,i,z;     clrscr();     printf("Please enter a value:"...

Mushfiqur Rahman 31 Jan, 2013

Write a C program to determine whether a number is a prime or not.

#include<stdio.h> #include<conio.h> void main() {     int i,j,n,b=0;     clrscr();     printf("Please enter a number:...

Mushfiqur Rahman 31 Jan, 2013

Write a C program to find the number of and sum of all integers greater than 50 and less than 300 that are divisible by 9

#include <stdio.h> #include <conio.h> main() {     int i,sum=0;     clrscr();     for(i=51;i<300;i++)     {         if(i%9==...

Mushfiqur Rahman 31 Jan, 2013

Write a program that read the value of x and evaluate the following function using if statement and ?: Operator

#include <stdio.h> #include <conio.h> void main() {        clrscr();     int x,y;        scanf("%d", &x);     if(...

Mushfiqur Rahman 31 Jan, 2013

Write a program that evaluate y = xn

#include <stdio.h> #include <conio.h> #include <MATH.h> void main() {        clrscr();     int x,n;        scanf("%d...

Mushfiqur Rahman 31 Jan, 2013

Write a program that will obtain the length and width of a rectangle from the user and Compute its area and perimeter.

#include <stdio.h> #include<CONIO.H> main() { clrscr(); float length, breadth, aor, por; printf ("\nEnter the Length and B...

Mushfiqur Rahman 31 Jan, 2013

Write a C program to compute the roots of a quadratic equation.

#include<stdio.h> #include<conio.h> main() {     clrscr();     float a,b,c,d,x1,x2;     printf("Please Enter the value of ...

Mushfiqur Rahman 31 Jan, 2013

Write a c program for triangle

#include <stdio.h> #include <conio.h> void main()  {    float ht,base,area;    clrscr();    printf("Enter the height and b...

Mushfiqur Rahman 31 Jan, 2013

Write a program to calculate the area and circumference of a circle.

#include <stdio.h> #include<conio.h> #define PI 3.1416 main() { float radius, aoc, coc; clrscr(); printf("\nEnter the Radi...

Mushfiqur Rahman 31 Jan, 2013

Write a C program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7

#include <stdio.h> #include <conio.h> main() {     int i,sum=0;     clrscr();     for(i=100;i<200;i++)     {         if(i%7=...

Mushfiqur Rahman 31 Jan, 2013

Write a program to calculate of average of five numbers.

#include<stdio.h> #include<conio.h> main() {   clrscr();        int a,b,d,c,e,sum;        float avg;     printf("Enter mar...

Mushfiqur Rahman 31 Jan, 2013

Write a program to convert the given temperature in Fahrenheit to Celsius.

#include <stdio.h> #include <conio.h> main() {      float  f,c;     clrscr();     printf( "Enter a Farhenite...

Mushfiqur Rahman 31 Jan, 2013

What are the difference between global and local variables?

Global Variable Local Variable Global Variable is variable which is declared before main function. ...

Mushfiqur Rahman 31 Jan, 2013

In what ways does a switch statement differ from an IF statement?

The if statement is a conditional branch, a branch to other statements if a certain condition or set of conditions is met. The conditi...

Mushfiqur Rahman 31 Jan, 2013

What is the difference between ++m and m++?

If the Increment operator has placed before the operand it Increment first and other operations later. Example: m=5        x = ++m...

Mushfiqur Rahman 31 Jan, 2013

What is the difference between --m and m--?

If the decrement operator has placed before the operand it decrement first and other operations later. Example: m=5        x = --m...

Mushfiqur Rahman 31 Jan, 2013