Hi Friends,
I hope you are enjoying the day.
Feeling blessed for 2015, now I have a list of friends. I hope this new year bring too much smiles n success.
Thank you
Hi Friends,
I hope you are enjoying the day.
Feeling blessed for 2015, now I have a list of friends. I hope this new year bring too much smiles n success.
Thank you
1. Scrolling Text in a text box
1. Scrolling Text in a text box
Dear Student,
Term End practical examination Dec 2015 for MCA programme is scheduled at IGNOU Study Centre, UPTEC Computer Consultancy, Rana Pratap Marg, Lucknow from 10th January 2016. It is advised to contact examination supdt one day prior to the practical examination to know about your session and batch. Course wise list is also uploaded in RC Lucknow website.
Regional Director,
IGNOU RC Lucknow.
Dear Student,
Term End practical examination Dec 2015 for MCA programme is scheduled at IGNOU Study Centre, UPTEC Computer Consultancy, Rana Pratap Marg, Lucknow from 10th January 2016. It is advised to contact examination supdt one day prior to the practical examination to know about your session and batch. Course wise list is also uploaded in RC Lucknow website.
Regional Director,
IGNOU RC Lucknow.
First US$ 5000 of income: 0% tax
Next US$ 10,000 of income: 10% tax
Next US$ 20,000 of income: 15% tax
An amount above US$ 35,000: 20% tax.
For example, somebody earning US$ 38,000 annually
would owe US$ 5000 X 0.00+ 10,000 X 0.10 + 20,000 X 0.15 + 3,000 X 0.20,
which comes to US$ 4600. Write a program that uses a loop to input the income and calculate and report the owed tax amount. Make sure that your calculation is mathematically accurate and that truncation errors are eliminated
#include<stdio.h>
#include<conio.h>
void main()
{
float income,i=0,j=0,k=0,tax=0;
clrscr();
printf("\n\n\t\tEnter Your Income Tax -> ");
scanf("%f",&income);
/*--------Calculate The Tax---------*/
if(income>35000)
{
income=income-35000;
i=10000*.10;
j=20000*.15;
k=income*.20;
tax=i+j+k;
printf("\n\n\t\tYour Tax is %f",tax);
}
else if(income>20000 && income<=35000)
{
income=income-15000;
i=10000*.10;
j=income*.15;
tax=i+j;
printf("\n\n\t\tYour Tax is %f",tax);
}
else if(income>10000 && income<=20000)
{
income=income-15000;
i=10000*.10;
j=income*.15;
tax=i+j;
printf("\n\n\t\tYour Tax is %f",tax);
}
else if(income>5000 && income<=10000)
{
income=income-5000;
tax=income*.10;
printf("\n\n\t\tYour Tax is %f",tax);
}
else
{
printf("\n\n\t\t You have no tax");
}
getch();
}
First US$ 5000 of income: 0% tax
Next US$ 10,000 of income: 10% tax
Next US$ 20,000 of income: 15% tax
An amount above US$ 35,000: 20% tax.
For example, somebody earning US$ 38,000 annually
would owe US$ 5000 X 0.00+ 10,000 X 0.10 + 20,000 X 0.15 + 3,000 X 0.20,
which comes to US$ 4600. Write a program that uses a loop to input the income and calculate and report the owed tax amount. Make sure that your calculation is mathematically accurate and that truncation errors are eliminated
#include<stdio.h>
#include<conio.h>
void main()
{
float income,i=0,j=0,k=0,tax=0;
clrscr();
printf("\n\n\t\tEnter Your Income Tax -> ");
scanf("%f",&income);
/*--------Calculate The Tax---------*/
if(income>35000)
{
income=income-35000;
i=10000*.10;
j=20000*.15;
k=income*.20;
tax=i+j+k;
printf("\n\n\t\tYour Tax is %f",tax);
}
else if(income>20000 && income<=35000)
{
income=income-15000;
i=10000*.10;
j=income*.15;
tax=i+j;
printf("\n\n\t\tYour Tax is %f",tax);
}
else if(income>10000 && income<=20000)
{
income=income-15000;
i=10000*.10;
j=income*.15;
tax=i+j;
printf("\n\n\t\tYour Tax is %f",tax);
}
else if(income>5000 && income<=10000)
{
income=income-5000;
tax=income*.10;
printf("\n\n\t\tYour Tax is %f",tax);
}
else
{
printf("\n\n\t\t You have no tax");
}
getch();
}
#include<conio.h>
#include<string.h>
struct emp{
char name[10];
int age;
};
File handling concept
void NameAndAgeStoring(){
struct emp e;
FILE *p, *q;
p= fopen("list.txt","a");
q= fopen("list.txt","r");
printf("enter the name and age");
scanf("%s %d",e.name,e.age);
fprintf(p,"%s %d",e.name,e.age);
fclose(p);
do{
fscanf(q,"%s %d",e.name,e.age);
printf("%s %d",e.name,e.age);
}
while(!feof(q));
getch();
}
File handling concept - Create and store value
void file(){
FILE *fp;
char ch;
fp = fopen("names.txt", "w");
while( ( ch= getchar())!=EOF){
putc(ch,fp);
}
fclose(fp);
}
string length without strlen()
void stringCal(){int i;
char str[1000];
printf("enter string value \n");
scanf("%s",str);
for(i=0; str[i] != '\0';++i){
}
printf(" number of char entered %d",i);
getch();
}
string reverse using pointer concept
int stringReverse(){char str[1000], *ptr;
int i, len;
printf("enter string \n");
gets(str);
ptr = str;
for(i=0; i <1000;i++)
{
if(*ptr == '\0'){
break;
}
ptr++;
}
len=i;
ptr--;
printf("revered string: ");
for(i=len; i>0; i--){
printf("%c",*ptr--);
}
getch();
return 0;
}
search name in file - file concept
void SearchName(){FILE *fp;
char ch[10],t[10], rep[10];
int flag=0;
printf("enter the value to search \n");
gets(t);
fp = fopen("names.dat","a+");
//tp =fopen("names.dat","w+");
do{
fscanf(fp,"%s\n",ch);
if(strcmp(ch,t) == 0){
//printf("%s\n",ch);
printf("name found, enter the replacement value \n");
gets(rep);
flag=1;
fseek(fp,0,SEEK_SET);
fprintf(fp,"%s\n",rep);
fclose(fp);
break;
}else{
//printf("not found \n");
}
}
while(!feof(fp));
fclose(fp);
if(flag==0)
{
printf("name not matched \n");
}else
{
printf("name replaced successfully \n");
}
getch();
}
#include<conio.h>
#include<string.h>
struct emp{
char name[10];
int age;
};
File handling concept
void NameAndAgeStoring(){
struct emp e;
FILE *p, *q;
p= fopen("list.txt","a");
q= fopen("list.txt","r");
printf("enter the name and age");
scanf("%s %d",e.name,e.age);
fprintf(p,"%s %d",e.name,e.age);
fclose(p);
do{
fscanf(q,"%s %d",e.name,e.age);
printf("%s %d",e.name,e.age);
}
while(!feof(q));
getch();
}
File handling concept - Create and store value
void file(){
FILE *fp;
char ch;
fp = fopen("names.txt", "w");
while( ( ch= getchar())!=EOF){
putc(ch,fp);
}
fclose(fp);
}
string length without strlen()
void stringCal(){int i;
char str[1000];
printf("enter string value \n");
scanf("%s",str);
for(i=0; str[i] != '\0';++i){
}
printf(" number of char entered %d",i);
getch();
}
string reverse using pointer concept
int stringReverse(){char str[1000], *ptr;
int i, len;
printf("enter string \n");
gets(str);
ptr = str;
for(i=0; i <1000;i++)
{
if(*ptr == '\0'){
break;
}
ptr++;
}
len=i;
ptr--;
printf("revered string: ");
for(i=len; i>0; i--){
printf("%c",*ptr--);
}
getch();
return 0;
}
search name in file - file concept
void SearchName(){FILE *fp;
char ch[10],t[10], rep[10];
int flag=0;
printf("enter the value to search \n");
gets(t);
fp = fopen("names.dat","a+");
//tp =fopen("names.dat","w+");
do{
fscanf(fp,"%s\n",ch);
if(strcmp(ch,t) == 0){
//printf("%s\n",ch);
printf("name found, enter the replacement value \n");
gets(rep);
flag=1;
fseek(fp,0,SEEK_SET);
fprintf(fp,"%s\n",rep);
fclose(fp);
break;
}else{
//printf("not found \n");
}
}
while(!feof(fp));
fclose(fp);
if(flag==0)
{
printf("name not matched \n");
}else
{
printf("name replaced successfully \n");
}
getch();
}