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 :-
9
18
27
36
45
54
63
72
81
90
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 4
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 x
10
Enter the value of x
20
Enter the value of x
30
Enter the value of x
40
Enter the value of x
50
The sum is 150
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 x
10
Enter the value of x
20
Enter the value of x
30
Enter the value of x
40
Enter the value of x
50
The sum is 150
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 5040
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 5040
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)




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 first paper and
ten minutes before the time fixed for setting of each subsequent paper.

THEY ARE FORBIDDEN TO TAKE ANY BOOK OR PAPER INTO THE EXAMINATION HALL.

Seat numbers and places of examination will be announced on the college notice boards four
days prior to the date of commencement of the examination.

Smoking is strictly prohibited in the examination hall.

The written examination will be conducted in the following order :-

Day Date Paper
Friday April 09, 2010 Account 1 - Financial Accounting
Business Management I - Management and Organization Development
Saturday April 10, 2010 Accounts 2 - Auditing and Cost Accounting
Business Management II - Financial Management
Tuesday April 27, 2010 Accounts 3 - Management Accounting Etc. (Rev.)
Business Management III - Marketing Management
Tuesday April 13, 2010 Direct and Indirect Taxation
Thursday April 15, 2010 Business Economics
Friday April 16, 2010 MPP(Management and
Production Planning.)
Saturday April 17, 2010 Export Marketing
Monday April 19, 2010 Computer Systems and Applications
Tuesday April 20, 2010 Psychology of Human Behaviour at work.
Wednesday April 21, 2010 Marketing Research
Thursday April 22, 2010 International Marketing
Investment Analysis Portfolio Management
Friday April 23, 2010 Rural Marketing
Saturday April 24, 2010 Entrepreneurship and M.S.S.I
Monday April 26, 2010 Elements of Operation Research

Motorola BACKFLIP Android Phone (AT&T)

Nokia Nuron 5230 Phone, Frost White (T-Mobile)

Nokia Nuron 5230 Phone, Frost White (T-Mobile)
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 Tuesday 23th February 2010 and will be conducted in the following order.
GENERAL & BIOFOCAL(VOCATIONAL) COURCES
-----------------------------------------------------------
DAY DATE TIME SUBJECT IND NO
-----------------------------------------------------------
TUE 23-02-2010 FIRST HALF
11.00 AM-2.00 PM MARATHI (02)
GUJARATHI (03)
KANNADA (06)
SINDHI (07)
MALAYALAM (08)
TAMIL (09)
TELUGU (10)
PUNJABI (11)
BENGALI (12)
-----------------------------------------------------------
TUE 23-02-2010 SECOND HALF
3.00 PM-6.00 PM URDU (05)
FRENCH (13)
PALI (35)
-----------------------------------------------------------
WED 24-02-2010 FIRST HALF
11.00 AM-2.00 PM ENGLISH (01)
-----------------------------------------------------------
THU 25-02-2010 FIRST HALF

11.00 AM-2.00 PM HINDI (04)
-----------------------------------------------------------
THU 25-02-2010 SECOND HALF
3.00 PM-6.00 PM GERMAN (14)
ARDHAMAGADHI (16)
PERSIAN (37)
AVESTA-PAHLAVI (87)
-----------------------------------------------------------
FRI 26-02-2010 FIRST HALF
11.00 AM-1.00 PM MATHEMATICS & STATISTICS PAPER-1 (A/S)(40)
11.00 AM-1.00 PM MATHEMATICS & STATISTICS PAPER-1 (C)(88)
-----------------------------------------------------------
FRI 26-02-2010 SECOND HALF
3.00 PM-6.00 PM SOCIOLOGY(A/S) (45)
-----------------------------------------------------------
TUE 02-03-2010 FIRST HALF
11.00 AM-1.00 MATHEMATICS & STATISTICS PAPER-II (A/S)(40)
11.00 AM-1.00 MATHEMATICS & STATISTICS PAPER-II (C)(88)
-----------------------------------------------------------
TUE 02-03-2010 SECOND HALF
3.00 PM-5:30 PM TEXTILE LAUNDRY & CLOTHING(A/S)(44)
-----------------------------------------------------------
THU 04-03-2010 FIRST HALF
11.00 AM-2.00 PM SECRETARIAL PRACTICE(C)(52)
11.00 AM-1.00 PM PHYSICS PAPER I(S)(54)
-----------------------------------------------------------
THU 04-03-2010 SECOND HALF
3.00 PM-6.00 PM POLITICAL SCIENCE (A)(42)

-----------------------------------------------------------
FRI 05-03-2010 FIRST HALF
11.00 AM-2.00 PM ORGANISATION OF COMMERCE & MANAGEMENT (C)(51)
11.00 AM-1.00 PM PHYSICS PAPER- II (S) (54)
-----------------------------------------------------------
FRI 05-03-2010 SECOND HALF
3.00 AM-6.00 PM HISTORY (A) (38)
-----------------------------------------------------------
SAT 06-03-2010 FIRST HALF
11.00 AM-2.00 PM BOOK KEEPING & ACCOUNTING(A/C)(50)
11.00 AM-1.00 PM CHEMISTRY PAPER-I (S)(55)
-----------------------------------------------------------
SAT
06-03-2010 SECOND HALF
3.00 AM-6.00 PM PHILOSOPHY (A) (46)
-----------------------------------------------------------
MON
08-03-2010 FIRST HALF
11.00 PM-2.00 PM CO-OPERATION (A/C) (53)
11.00 AM-1.00 PM CHEMISTRY PAPER-II (S)(55)
-----------------------------------------------------------
TUE 09-03-2010 FIRST HALF
11.00 AM-1.00 PM BIOLOGY-PAPER-I(S)(56)

-----------------------------------------------------------
TUE
09-03-2010 SECOND HALF
3.00 PM-6.00 PM ECONOMICS (A/S/C) (49)
-----------------------------------------------------------
WED 10-03-2010 FIRST HALF
11.00 AM-1.00 PM BIOLOGY-PAPER-II(S)(56)

-----------------------------------------------------------
WED 10-03-2010 SECOND HALF
3.00 PM-6.00 PM LOGIC(A)(47)
-----------------------------------------------------------
THU 11-03-2010 FIRST HALF
11.00 AM-2.00 PM RUSSIAN (20)
11.00 AM-2.00 PM JAPANESE (21)
11.00 AM-2.00 PM SANSKRIT (33)
11.00 AM-2.00 PM ARABIC (36)
-----------------------------------------------------------
THU 11-03-2010 FIRST HALF
11.00 AM-2.00 PM GENERAL KNOWLEDGE (32)

(FOR MILITARY SCHOOL)
-----------------------------------------------------------
THU
11-03-2010 SECOND HALF
3.00 PM-5.30 PM CHILD DEVELOPMENT (A/S) (43)
-----------------------------------------------------------
THU
11-03-2010 SECOND HALF
3.00 PM-5.00 PM CROP PRODUCTION PAPER I (75)
(SCIENCE & AGRIL)
ANIMAL SCIENCE- PAPER I (76)
(SCIENCE & AGRIL)
-----------------------------------------------------------
 FRI 12-03-2010   FIRST HALF     
11.00 AM-12.00 PM EUROPEAN MUSIC (A) (73)
-----------------------------------------------------------
FRI
12-03-2010 SECOND HALF
3.00 PM-6.00 PM GEOGRAPHY (A/S/C) (39)

-----------------------------------------------------------
SAT 13-03-2010 FIRST HALF
11.00 AM-1.00 PM GEOLOGY PAPER - I (S) (41)
11.00 AM-2.00 PM HISTORY & APPRECIATION (60)
                            OF ART (PAINTING SCULPTURE
& ARCHITECTURE)(A)
----------------------------------------------------------
SAT 13-03-2010 SECOND HALF
3.00 PM-5.00 PM CROP PRODUCTION PAPER II (75)
(SCIENCE, AGRI.)
3.00 PM-5.00 PM ANIMAL SCIENCE PAPER II (76)
3.00 PM-5.30 PM DEFENCE STUDIES (A/S/C) (77)

-----------------------------------------------------------
MON 15-03-2010 FIRST HALF

11.00 AM-2.00 PM PSYCHOLOGY (A/S) (48)
-----------------------------------------------------------
MON 15/03/2010 SECOND HALF
3.00 PM-5.00 PM GEOLOGY PAPER-II (S) (41)
3.00 PM-5.30 PM PERCUSSION (A) (69)
-----------------------------------------------------------
VOCATIONAL SUBJECT EXAM WILL CONDUCT AS PER CURRENT SYLLABUS
WED 17/03/2010  FIRST HALF      
VOCATIONAL COURSES PAPER-I(TECHNICAL GROUP)
11.00 AM-1.30 PM ELECTRICAL MAINTENANCE (A1)
11.00 AM-1.30 PM MECHANICAL MAINTENANCE (A2)
11.00 AM-1.30 PM SCOOTER & MOTOR CYCLE (A3)
SERVICING
11.00 AM-2.00 PM ELECTRONICS (C2)
11.00 AM-2.00 PM COMPUTER SCIENCE (D9)

COMMERCE GROUP PAPER-I
11.00 AM-2.00 PM BANKING (A5)
OFFICE MANAGEMENT (A7)
MARKETING & SALESMANSHIP (A8)
SMALL INDS. & SELF (A9)
EMPLOYMENT
FISHERY GROUP PAPER-I
11.00 AM-2.00 PM FISH PROCESSING TECHNOLOGY (B9)
FRESH WATER FISH CULTURE (C1)
AGRICULTURE GROUP PAPER-I
11.00 AM-1.00 PM ANIMAL SCIENCE & DAIRYING (B2)
CROP SCIENCE (B4)
HORTICULTURE (B5)
          INFORMATION TECHNOLOGY(ON LINE EXAM) 
11.00 AM-1.30 PM SCIENCE (97)
ARTS (98)
COMMERCE (99)
-----------------------------------------------------------
WED 17/03/2010 SECOND HALF

3.00 PM-6.00 PM EDUCATION (A/S) (78)

INFORMATION TECHNOLOGY(ON LINE EXAM)
3.00 PM-5.30 PM SCIENCE (97)
ARTS (98)
COMMERCE (99)
-----------------------------------------------------------
THU 18/03/2010 FIRST HALF
11.00 AM-2.00 PM HISTORY & DEVELOPMENT
OF INDIAN MUSIC (A) (65)
VOCATIONAL COURSES PAPER-I
I (TECHNICAL GROUP)
11.00 AM-2.00 PM GENERAL CIVIL ENGG. (A4)
11.00 AM-1.30 PM ELECTRICAL MAINTENANCE (A1)
MECHANICAL MAINTENANCE (A2)
SCOOTER & MOTOR CYCLE (A3)
SERVICING
11.00 AM-2.00 PM COMPUTER SCIENCE (D9)
ELECTRONICS (C2)
COMMERCE GROUP PAPER-
II
11.00 AM-2.00 PM BANKING (A5)
OFFICE MANAGEMENT (A7)
MARKETING & SALESMANSHIP (A8)
SMALL INDS.& SELF EMPLOYMENT(A9)
FISHERY GROUP PAPER-
II
11.00 AM-2.00 PM FISH PROCESSING TECHN. (B9)
FRESH WATER FISH CULTURE (C1)
AGRICULTURE GROUP PAPER-
II
11.00 AM-1.00 PM ANIMAL SCIENCE & DAIRYING (B2)
CROP SCIENCE (B4)
HORTICULTURE (B5)
           INFORMATION TECHNOLOGY(ON LINE EXAM) 
11.00 AM-1.30 PM SCIENCE (97)
ARTS (98)
COMMERCE (99)

-----------------------------------------------------------
THU
18/03/2010 SECOND HALF

3.00 PM-5.00 PM LIBRARY & INFORMATION
                           SCIENCE (A/C)               (85)
3.00 PM-6.00 PM HISTORY & DEVELOPMENT OF
INDIAN CLASSICAL DANCE (A) (91)

INFORMATION TECHNOLOGY(ON LINE EXAM)
3.00 PM-5.30 PM SCIENCE (97)
ARTS (98)
COMMERCE (99)
-----------------------------------------------------------
FRI 19/03/2010 FRIST HALF

INFORMATION TECHNOLOGY(ON LINE EXAM)
11.00 AM-1.30 PM SCIENCE (97)
ARTS (98)
COMMERCE (99)
-----------------------------------------------------------
FRI 19/03/2010 SECOND HALF

INFORMATION TECHNOLOGY(ON LINE EXAM)
3.00 PM-5.30 PM SCIENCE (97)
ARTS (98)
COMMERCE (99)
-----------------------------------------------------------
VIEWER MUST CONFIRM THE DATE & TIME FROM THEIR
INSTITUTION BEFORE THE EXAMINATION .
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 loop.

Output :-
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
Happy Birthday
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 parameter.
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 false.
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 false.
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)
{
statements;
}
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 15 :
printf("\n VERY GOOD \n");
break;

case 25 :
printf("\n BEST \n");
break;

default :
printf("\n BAD \n");
}
}

For eg :-

Output :-
Enter the value of TRY
25
BEST
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 formula
net salary (ns) = basic pay (bp) + hra - pf.
where hra and pf are calculated as per the following rules.

















Categoryhra
pf
o - officer
15% of bp
9% of bp
m - manager
10% of bp
8% of bp
w - worker
5% of bp
7% of bp




#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
char cat, name [20];
float bp, hra, pf, ns;
clrscr();
printf("Enter employee name, category and basic pay \n");
scanf("%s %c %f", name, &cat, &bp);
switch(cat)
{
case 'o' :
hra = bp * 0.15;
pf = bp * 0.09;
break;

case 'm' :
hra = bp * 0.1;
pf = bp * 0.08;
break;

case 'w' :
hra = bp * 0.05;
pf = bp * 0.07;
break;

default :
hra = 0.0;
pf = 0.0;
}
ns = bp + hra - pf;
printf("Net salary = Rs. %f \n", ns);
}

For eg :-

Output :-
Enter employee name, category and basic pay
Fransis 0 10000
Net salary = Rs. 10600.000000
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

Category
Wages per hour (in Rs.)
1
100
2
80
3
60
4
300




#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 is %s and wages = Rs. %f \n, name, wages");
}

For eg :-

Output :-
Enter the name, category, hours worked
Fransis 4 7
Name is Fransis and wages = Rs. 210.000000
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 'C' :
printf("\n Commerce student \n");
break;

default :
printf("\n Not a student \n");
}
}

For eg :-

Output:-
Enter any alphabet form A , S , C
Commerce student
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 4:
printf("\n Fail \n");
break;

default :
printf("\n Not Suitable \n");
}
return(0);
}


For eg :-

Output :-
Enter any integer from 1 to 4
1
First Class
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 structure.
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 class
if % between 50 and less than 60 than second class
if % between 40 and less than 50 than third class
if % below 40 then fail



#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int m1, m2, m3, m4, m5, m6, m7, sum;
float per;
printf("Enter the marks in 7 subjects \n");
scanf("%d %d %d %d %d %d %d",&m1,&m2,&m3,&m4,&m5,&m6,&m7);
sum = m1 + m2 + m3 + m4 + m5 + m6 + m7;
per = sum / 7;
if(per >= 60)
printf("Per = %f First Class \n", per);
else
if(per >= 50)
printf("Per = %f Second Class \n", per);
else
if(per >= 40)
printf("Per = %f Third Class \n", per);
else
printf("Per = %f Fail \n", per);
return(0);
}


For eg :-

Output :-
Enter the marks in 7 subjects
10 20 30 40 50 60 70
Per = 40.000000 Third Class
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 + da

Write a program in 'C' to enter the basic pay and to find and print the hra, da and the gross salary.




#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
float bp, hra, da, gs;
printf(" \n Enter the basic pay \n");
scanf("%f", &bp);
if (bp < 2000)
{
hra = bp * 10/100;
da = bp * 90/100;
}
else
{
hra = 500.0;
da = bp * 98/100;
}
gs = bp + hra + da;
printf("The hra is Rs. %f \n", hra);
printf("The da is Rs. %f \n", da);
printf("The gross salary is %f \n", gs);
return(0);
}

For eg :-

Output :-
Enter the basic pay
1000
The hra is Rs. 100.000000
The da is Rs. 900.000000
The gross salary is Rs. 2000.000000
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.)

 Toshiba Satellite L505-GS5037 TruBrite 15.6-Inch Laptop (Black)
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);
}


Samsung 2233SW 21.5-Inch Full HD Widescreen LCD Monitor
For eg :-

Output :-
Enter any integer
25
The integer 25 is odd

Output :-
Enter any integer
10
The integer 10 is even

ViewSonic VA2223wm 22-Inch 16:9 1080p LCD Monitor
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");
else
if (a < 0) printf("The integer is negative\n");
else
printf("The integer is Zero\n");
return(0);
}

For eg :-

Output :-
Enter any integer
25
The integer is positive


Output :-
Enter any integer
-32
The integer is negative

Output :-
Enter any integer
0
The integer is Zero
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 numbers
20.5 32.3
The minimum number is 20.500000
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;
else
max = b;
printf("The maximum number is %f\n", max);
return(0);
}

For eg :-

Output :-
Enter any two numbers
20.5 32.3
The maximum number is 32.300000
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 is

if (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 statement set 2 is called as "else block"
2) else should be written below if.
3) Both the statement sets 1 and 2 should be written little towards the right side. This is the formatting convention.
4) Both the statement set should be enclosed in a pair of braces { } but braces are not required in case of single statement.
5) Both the statement sets must end with semicolon ;
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) do...................while,
5) for,
read more "Control Statement in 'C'"

Unformatted Output Function



































Unformatted Output FunctionHeader FileUse of the function
1) 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 y.
read more "Unformatted Output Function"

Unformatted Input Function






























Unformatted Input FunctionHeader FileUse of the function
1) getch( );conio.hIt reads the typed single character instantly but does not echo / display it on the screen. Enter key is not required
2) 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 the character on the screen.
4) gets();stdio.hIt reads the typed string completely only after hitting the enter key. It echoes the string on the screen
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 number
2.5
The Square is 6.250000
The Cube is 15.6250000
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 number
25
The Square root 25 is 5.000000
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 negative

2) 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 y
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. %f\n", ns);
return(0);
}
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 Function
Input Function
Header File
Use of the function
1) getch( );
conio.h

It reads the typed single character instantly but does not echo / display it on the screen. Enter key is not required
2) getche( );
conio.h
It reads the typed single character instantly and echoes / displays it on the screen. Enter key is not required.

3) getchar();
stdio.h

It reads the typed single character only after hitting the enter key. It echoes / display the character on the screen.






4)gets();
stdio.h
It read the typed string completely only after hitting the enter key. It echoes the string on the screen

read more "Unformatted Input Function"

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP