Write a program in c to find and print the product p = 15 * 14 * 13 * .... * 1
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< main() { int x, y; x = 9; for (y = 1; y < = 10; y = y + i) { printf("%d \n", x *y); } return(0); } |
---|
#include< #include< #include< main() { int i; for (i = 12; i > = 4; i = i - 2) { printf("%d \t", i); } return(0); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
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 |
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 | ||
----------------------------------------------------------- FRI 12-03-2010 FIRST HALF ----------------------------------------------------------- OF ART (PAINTING SCULPTURE ----------------------------------------------------------
VOCATIONAL SUBJECT EXAM WILL CONDUCT AS PER CURRENT SYLLABUS WED 17/03/2010 FIRST HALF INFORMATION TECHNOLOGY(ON LINE EXAM) INFORMATION TECHNOLOGY(ON LINE EXAM) SCIENCE (A/C) (85) |
#include< main() { int i = 1; while (i < = 10) { printf("Happy Birthday \n"); i = i +1; } return(0); } |
---|
#include< main() { int i = 1; do { printf("Happy Birthday \n"); i = i + 1; } while (i < = 10) return(0); } |
---|
#include< main() { int i; for (i = 1; i < = 10; i = i+1) { printf("Happy Birthday \n"); } return(0); } |
---|
#include< #include< #include< 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"); } } |
---|
Category | hra | 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< #include< #include< 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); } |
---|
Category | Wages per hour (in Rs.) |
---|---|
1 | 100 |
2 | 80 |
3 | 60 |
4 | 300 |
#include< #include< #include< 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"); } |
---|
#include< #include< #include< 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"); } } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< #include< main() { float a, b, min; printf("Enter any two numbers\n"); scanf("%f %f", &a, &b); if(a < min =" a;" min =" b;"> |
---|
#include< #include< #include< 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); } |
---|
Unformatted Output Function | Header File | Use of the function |
1) putch( ); | conio.h | It print the single character on the screen. |
2) putchar( ); | stdio.h | It print the single character on the screen. |
3) puts(); | stdio.h | It print the string completely on the screen. |
4) sqrt(n); | math.h | It print the square root of a non-negative number. |
5) pow(x , y ); | math.h | It print the value of x rest to y. |
Unformatted 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 reads the typed string completely only after hitting the enter key. It echoes the string on the screen |
#include< #include< #include< 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); } |
---|
#include< #include< #include< 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); } |
---|
#include< #include< 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); } |
---|
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 |
---|---|---|
© Blogger templates Newspaper III by Ourblogtemplates.com 2008
Back to TOP