Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Saturday, January 23, 2010

Write a program in c to find and print the product p = 15 * 14 * 13 * .... * 1

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, p; p = 1; for (i=15; i > = 1; i=i-1) { p = p * i; } printf("\n The product is %d \n", p); return(0); }...
read more "Write a program in c to find and print the product p = 15 * 14 * 13 * .... * 1"

Write a program in c to find the sum s = 1/3 + 3/5 + 5/7 + 7/9 + 9/11 +11/13 + 13/15

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, s; s = 0; for (i=1; i < = 13; i=i+2) { s = s + i / (i+2); } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c to find the sum s = 1/3 + 3/5 + 5/7 + 7/9 + 9/11 +11/13 + 13/15"

Write a program in c to find the sum s = 1/2 + 3/4 + 5/6 + 7/8 + 9/10 + 11/12

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, s; s = 0; for (i=1; i < = 11; i=i+2) { s = s + i / (i+1); } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c to find the sum s = 1/2 + 3/4 + 5/6 + 7/8 + 9/10 + 11/12"

Write a program in c to find the sum s = 1*6 + 2*9 + 3*12 + 10*33

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, j, s; s = 0; for (i=1, j=6; i < = 10, j < = 33; i=i+1, j=j+3) { s = s + i * j; } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c to find the sum s = 1*6 + 2*9 + 3*12 + 10*33"

Write a program in c to find and print the product p = 3 * 6 * 9 * ....... * 30

#include<stdio.h> #include<conio.h> #include<math.h> main() { int j, p; p = 1; for ( j=3; j < = 30; j=j+3) { p = p * j; } printf("\n The product is %f \n", p); return(0);...
read more "Write a program in c to find and print the product p = 3 * 6 * 9 * ....... * 30"

Write a program in c to find and print the product p = 1 * 2 * 3 * 4 * ...... *10

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, p; p = 1; for ( i=1; i < = 10; i++) { p = p * i; } printf("\n The product is %f \n", p); return(0);...
read more "Write a program in c to find and print the product p = 1 * 2 * 3 * 4 * ...... *10"

Write a program in c to find the sum s = 1*2 + 2*3 + 3*4 + 4*5 + .... + 10*11

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, s; s = 0; for (i=1; i < = 10; i++) { s = s + i * (i++); } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c to find the sum s = 1*2 + 2*3 + 3*4 + 4*5 + .... + 10*11"

Write a program in c find the sum of s = 1*3 + 3*5 + 5*7 + 7*9 + ............. + 21*23

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, s; s = 0; for (i=1; i < = 21; i=i+2) { s = s + i * (i+2); } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c find the sum of s = 1*3 + 3*5 + 5*7 + 7*9 + ............. + 21*23"

Write a program in c find the sum of s = 2 + 4 + 6 + 8 + ........... + 20

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, s; s = 0; for (i=2; i < = 20; i=i+2) { s = s + i; } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c find the sum of s = 2 + 4 + 6 + 8 + ........... + 20"

Write a program in c to find the sum ( s = 1 + 2 + 3 + 4 + 5 + ....... + 100 )

#include<stdio.h> #include<conio.h> #include<math.h> main() { int i, s; s = 0; for (i=1; i < = 100; i++) { s = s + i; } printf("\n The sum is %d \n", s); return(0); }...
read more "Write a program in c to find the sum ( s = 1 + 2 + 3 + 4 + 5 + ....... + 100 )"

Thursday, January 21, 2010

Write a program in c to print the table of 9 upto 10 multiples vertically

#include<stdio.h>#include<conio.h>#include<math.h>main(){int x, y;x = 9;for (y = 1; y < = 10; y = y + i){printf("%d \n", x *y);}return(0);} Output :-9182736455463728...
read more "Write a program in c to print the table of 9 upto 10 multiples vertically"

Write a program in c to print the values 12 , 10 , 8 , 6 , 4 at tab stops ( for loop )

#include<stdio.h>#include<conio.h>#include<math.h>main(){int i;for (i = 12; i > = 4; i = i - 2){printf("%d \t", i);}return(0);} Output:-12 10 8 6...
read more "Write a program in c to print the values 12 , 10 , 8 , 6 , 4 at tab stops ( for loop )"

Write a program in c using for loop / statement , to enter 5 integer values and to print their sum

#include<stdio.h>#include<conio.h>#include<math.h>main(){int i, x, sum;sum = 0;for ( i = 1; i < 5; i = i+1){printf("Enter the value of x \n");scanf("%d", &x);sum = sum + x;}printf("The sum is %d \n", sum);return(0);} Output:-Enter the value of x10Enter the value of x20Enter the value of x30Enter the value of x40Enter the value of x50The sum is ...
read more "Write a program in c using for loop / statement , to enter 5 integer values and to print their sum"

Write a program in c using while loop / statement , to enter 5 integer values and to print their sum

#include<stdio.h>#include<conio.h>#include<math.h>main(){int i, x, sum;sum = 0;i = 1;while ( i < = 5){printf("Enter the value of x \n");scanf("%d", &x);sum = sum + x;i = i + 1;}printf("The sum is %d \n", sum);return(0);} Output:-Enter the value of x10Enter the value of x20Enter the value of x30Enter the value of x40Enter the value of x50The sum is ...
read more "Write a program in c using while loop / statement , to enter 5 integer values and to print their sum"

Write a program in c using the do while loop calculate and print the product ( p = 1 * 2 * 3 * 4 * 5 * 6 * 7 )

#include<stdio.h>#include<conio.h>#include<math.h>main(){int i, p;p = 1;i = 1;do{p = p * i;i = i + 1;}while ( i < 8);printf("The product is %d\n", p);return(0);} Output:-The product is 5...
read more "Write a program in c using the do while loop calculate and print the product ( p = 1 * 2 * 3 * 4 * 5 * 6 * 7 )"

Write a program in c using for loop , calculate and print the product ( p = 1 * 2 * 3 * 4 * 5 * 6 * 7 )

#include<stdio.h>#include<conio.h>#include<math.h>main(){int i, p;p = 1;for (i=1; i<8; i=i+1){p = p * i;}printf("The product is %d\n", p);return(0);} Output:The product is 5...
read more "Write a program in c using for loop , calculate and print the product ( p = 1 * 2 * 3 * 4 * 5 * 6 * 7 )"

Saturday, January 16, 2010

tybcom exam timetable 2010

Motorola DROID A855 Android Phone (Verizon Wireless) BlackBerry Bold 9700 Phone (AT&T) REVISED PROGRAMME OF THE THIRD YEAR B.COM. (THREE YEAR DEGREE COURSE) EXAMINATION Candidates for the above examination are requested to be in attendance at the place of examination, fifteen minutes before the time appointed for setting of the...
read more "tybcom exam timetable 2010"

HSC exam timetable 2010

MAHARASHTRA STATE BOARD OF SECONDARY & HIGHER SECONDARY EDUCATION SHIVAJINAGAR PUNE - 4 TIME TABLE FOR THE H.S.C.(STD XII)EXAMINATION FEB/MARCH,2010 The H.S.C. Examination will commence on and from...
read more "HSC exam timetable 2010"

Saturday, January 9, 2010

Write a program in C to print " Happy Birthday " 10 times ( Using while loop , do ... while loop , for loop or statements)

This can be done in 3 different ways.1 - way #include<stdio.h>main(){int i = 1;while (i < = 10){printf("Happy Birthday \n");i = i +1;}return(0);} 2 - way #include<stdio.h>main(){int i = 1;do{printf("Happy Birthday \n");i = i + 1;}while (i < = 10)return(0);} 3 - way #include<stdio.h>main(){int i;for (i = 1; i < = 10; i = i+1){printf("Happy Birthday \n");}return(0);} Output is same in all above 3 different...
read more "Write a program in C to print " Happy Birthday " 10 times ( Using while loop , do ... while loop , for loop or statements)"

for loop or for statement

The syntax of this statement as follows :-for(exp1; exp2; exp3){statements;}Explaination :-In the for statement, there are 3 expression,exp1 is used to initialize or to start the index parameter.exp2 represents a condition to be satisfy for the execution of the loop.exp3 is used to change the value of index paramet...
read more "for loop or for statement"

do ........... while loop in C

The syntax of this statement as follows :-do{statements:}while(expression);Explaination :-In do ....... while loop first the statement are executed and then the expression in the bracket tested. The execution stops if the expression becomes fal...
read more "do ........... while loop in C"

while loop in C program

The syntax of this statement as follows :-1)while (expression){statements;}Explaination :-In while statement the bracket expression is a condition which is tested, if the condition is true the loop gets executed. The execution stops when the condition become fal...
read more "while loop in C program"

Repetitive statements in C

In some C program, we have to repeat certain step during program execution. This can be done with the help of the repetitive statements or loop statements. They are While, do ......... while, for.The syntax of this statement as follows :-1)while (expression){statements;}2)do{statements:}while(expression);3)for(exp1; exp2; exp3){statement...
read more "Repetitive statements in C"

Write a progam in C (WAPIC) Using switch ............. case

Write a progam in C (WAPIC) Using switch ............. case statement to examine the value of TRY.print GOOD if TRY has value 10,print VERY GOOD if TRY has value 15,print BEST if TRY has value 25,print BAD if TRY as any other values. #include<stdio.h>#include<conio.h>#include<math.h>void main(){int TRY;printf(" Enter the value of TRY \n");scanf("%d", &TRY);switch(TRY){case 10 :printf("\n GOOD \n");break;case...
read more "Write a progam in C (WAPIC) Using switch ............. case"

Using the switch .... case statement. Write a program in C

Write a program in C to enter employee name his categories and basic pay then calculate and print his net salary with the formulanet salary (ns) = basic pay (bp) + hra - pf.where hra and pf are calculated as per the following rules.Categoryhrapfo - officer15% of bp9% of bpm - manager10% of bp8% of bpw - worker5% of bp7% of bp #include<stdio.h>#include<conio.h>#include<math.h>void main(){char cat, name [20];float...
read more "Using the switch .... case statement. Write a program in C"

Wednesday, January 6, 2010

Write a program in C to enter the name , Category and the number of hours worked of an employee and then print his name and wages as per the following

CategoryWages per hour (in Rs.)11002803604300 #include<stdio.h>#include<conio.h>#include<math.h>void main(){char name [20];int cat, hrs;float wages;printf("Enter the name, category, hours worked \n");scanf("%s %d %d", name, &cat, &hrs);switch(cat){case 1:wages = hrs * 100;break;case 2:wages = hrs * 80;break;case 3:wages = hrs * 60;break;case 4:wages = hrs * 30;break;default :wages = 0.0;}Printf("Name...
read more "Write a program in C to enter the name , Category and the number of hours worked of an employee and then print his name and wages as per the following"

Tuesday, January 5, 2010

Write a program in C using switch case statement (Part-2)

Write a program in 'C' to enter an alphabet A or S or C and to print:-Arts student for A,Science student for s,Commerce student for c,and any other alphabet print not a student. #include<stdio.h>#include<conio.h>#include<math.h>void main(){char a;printf("\n Enter any alphabet form A , S , C \n");a = getchar( );switch(a){case 'A' :printf("\n Arts student \n");break;case 'S' :printf("\n Science student \n");break;case...
read more "Write a program in C using switch case statement (Part-2)"

Write a program in 'C' using switch case statement.

Write a program in C where the numbers 1,2,3 represent first,second and Third Class & the no. 4 represent fail or any other number print not suitable. #include<stdio.h>#include<conio.h>#include<math.h>main(){int n;printf("Enter any integer from 1 to 4 \n");scanf("%d", &n);switch(n){case 1:printf("\n First Class \n");break;case 2:printf("\n Second Class \n");break;case 3:printf("\n Third Class \n");break;case...
read more "Write a program in 'C' using switch case statement."

Monday, January 4, 2010

switch ................. case :-

It is a generalization of the if ............... else statement. It is a compound statement which gives some alternative course of action. The keyword switch is followed by bracket showing a variable name and the keyword case is followed by an integer or a single character constant called as the case label.The keyword break takes the control out of the switch structu...
read more "switch ................. case :-"

Write a program in 'C' to calculate marks and to find and assign the class (First, Second, Third, Fail) depending upon the percentage.(Using if else)

Write a program in 'C' to input the marks out of 100 obtained by a student in seven subject and to find and assign the class depending upon the percentage as follows:-if % 60 or above 60 than first classif % between 50 and less than 60 than second classif % between 40 and less than 50 than third classif % below 40 then fail #include<stdio.h>#include<conio.h>#include<math.h>main(){int m1, m2, m3, m4, m5, m6, m7,...
read more "Write a program in 'C' to calculate marks and to find and assign the class (First, Second, Third, Fail) depending upon the percentage.(Using if else)"

Write a program in 'C' to calculate house rent allowance (hra), Dearness allowance (da) and the gross & Net salary. (Using if.........else statement.)

Q.1) In a company the employee are paid as follows:-If basic pay (bp) is less than Rs. 2000/- then the house rent allowance (hra) is 10% of basic pay and dearness allowance (da) is 90% of basic pay.If basic pay is equal or more than Rs. 2000/- then the house rent allowance is Rs. 500/- and dearness allowance is 98% of basic pay.Gross salary (gs) = bp + hra + daWrite a program in 'C' to enter the basic pay and to find and print...
read more "Write a program in 'C' to calculate house rent allowance (hra), Dearness allowance (da) and the gross & Net salary. (Using if.........else statement.)"

Write a program in 'C' to test whether the given integer is even or odd and to print message accordingly.(Using if...........else statement.)

  HP 2009M 20-Inch HD LCD Monitor #include<stdio.h> #include<conio.h> #include<math.h> main() { int n; printf("Enter any integer\n"); scanf("%d", &n); if(n % 2 = = 0) printf("The integer %d is even \n", n); else printf("The integer %d is odd \n", n); return(0); } For eg :- Output :- Enter any integer 25 The...
read more "Write a program in 'C' to test whether the given integer is even or odd and to print message accordingly.(Using if...........else statement.)"

Write a program in 'C' to input an integer and to print whether it is positive, negative or zero.(Using if.............else statement)

#include<stdio.h>#include<conio.h>#include<math.h>main(){int a;clrscr( );printf("Enter any integer\n");scanf("%d", &a);if (a > 0)printf("The integer is positive\n");elseif (a < 0) printf("The integer is negative\n");elseprintf("The integer is Zero\n");return(0);} For eg :-Output :-Enter any integer25The integer is positiveOutput :-Enter any integer-32The integer is negativeOutput :-Enter any integer0The...
read more "Write a program in 'C' to input an integer and to print whether it is positive, negative or zero.(Using if.............else statement)"

Sunday, January 3, 2010

Write a program in 'C' to enter any two numbers and find and print their minimum.(Using if.....else statement)

#include<stdio.h>#include<conio.h>#include<math.h>main(){float a, b, min;printf("Enter any two numbers\n");scanf("%f %f", &a, &b);if(a < min =" a;" min =" b;"> For eg :-Output :-Enter any two numbers20.5 32.3The minimum number is 20.500...
read more "Write a program in 'C' to enter any two numbers and find and print their minimum.(Using if.....else statement)"

Write a program in 'C' to enter any two numbers and find and print their maximum.(Using if.....else statement)

#include<stdio.h>#include<conio.h>#include<math.h>main(){float a, b, max;printf("Enter any two numbers\n");scanf("%f %f", &a, &b);if(a > b)max = a;elsemax = b;printf("The maximum number is %f\n", max);return(0);} For eg :-Output :-Enter any two numbers20.5 32.3The maximum number is 32.300...
read more "Write a program in 'C' to enter any two numbers and find and print their maximum.(Using if.....else statement)"

if ........................ else statement

The syntax isif (expression) statement set 1;else statement set 2;The bracket contains a condition, the condition is tested, if the condition is true then statement set 1 gets executed and statement set 2 ignored.If the condition is false then statement set 2 gets executed and statement set 1 is ignored.Note that :-1) Statement set 1 is called as the "if block" and...
read more "if ........................ else statement"

Control Statement in 'C'

A computer program in usually executed in the same order in which the statement appear in the program but in some programs it is necessary to conduct a logical test and then the order of execution should be decided. This is called as conditional execution and it is done with the helps of control statement.We have the following control statement.1) if...........................else,2) switch.........................case,3) while,4)...
read more "Control Statement in 'C'"

Unformatted Output Function

Unformatted Output FunctionHeader FileUse of the function1) putch( );conio.hIt print the single character on the screen.2) putchar( );stdio.hIt print the single character on the screen.3) puts();stdio.hIt print the string completely on the screen.4) sqrt(n);math.hIt print the square root of a non-negative number.5) pow(x , y );math.hIt print the value of x rest to...
read more "Unformatted Output Function"

Unformatted Input Function

Unformatted Input FunctionHeader FileUse of the function1) getch( );conio.hIt reads the typed single character instantly but does not echo / display it on the screen. Enter key is not required2) getche( );conio.hIt reads the typed single character instantly and echoes / displays it on the screen. Enter key is not required.3)getchar();stdio.hIt reads the typed single character only after hitting the enter key. It echoes / display...
read more "Unformatted Input Function"

Saturday, January 2, 2010

Write a program in 'C' to enter any positive number and to calculate and print its square and cube

#include<stdio.h>#include<conio.h>#include<math.h>main(){float n, s, c;printf("Enter any positive number\n");scanf("%f", &n);s = pow(n , 2);c = pow(n , 3);printf("The Square is %f\n", s);printf("The Cube is %f\n", c);return(0);} For eg :-Output :-Enter any positive number2.5The Square is 6.250000The Cube is 15.6250...
read more "Write a program in 'C' to enter any positive number and to calculate and print its square and cube"

Write a program in 'C' enter a positive number and to calculate and print its square root (sqrt)

#include<stdio.h>#include<conio.h>#include<math.h>main(){float n, s;printf("Enter any positive number\n");scanf("%f", &n);s = sqrt(n);printf("The Square root of %f is %f\n", n, s);return(0);} For eg :-Output :-Enter any positive number25The Square root 25 is 5.000...
read more "Write a program in 'C' enter a positive number and to calculate and print its square root (sqrt)"

Mathematical header file <math.h>

<math.h> :- It means the mathematical header file which has some special mathematics function namely sqrt( ); and pow( , );1) sqrt( ); It means the square root function. The format is sqrt(n); where n should not be negative2) pow( , ); It means the power function. The format is pow(x , y); where x is base and y is the power i.e. pow(x , y) = x rest to...
read more "Mathematical header file <math.h>"

In a firm the employee gets house rent allowance as 10% of Basic pay and the Provident fund as 8.33% of Basic pay.

Write a program in 'C' to enter the basic pay (bp), to calculate and print the house rent (hra), the provident fund (pf) and net salary is (ns). #include<stdio.h>#include<conio.h>main(){int bp;float hra, pf, ns;clrscr();printf("Enter the Basic Pay\n");scanf("%d", &bp);hra = bp*10/100;pf = bp*8.33/100;ns = bp+hra-pf;printf("The hra is Rs. %f\n", hra);printf("The pf is Rs. %f\n", pf);printf("The Net Salary is Rs....
read more "In a firm the employee gets house rent allowance as 10% of Basic pay and the Provident fund as 8.33% of Basic pay."

Friday, January 1, 2010

Unformatted Input Function

Unformatted Input FunctionInput FunctionHeader FileUse of the function1) getch( );conio.hIt reads the typed single character instantly but does not echo / display it on the screen. Enter key is not required2) getche( );conio.hIt reads the typed single character instantly and echoes / displays it on the screen. Enter key is not required.3) getchar();stdio.hIt reads the typed single character only after hitting the enter key. It...
read more "Unformatted Input Function"

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP