|
Light Poster
|
|
| 5Feb2010,13:31 | #61 |
|
student
|
|
Go4Expert Member
|
|
| 5Feb2010,16:51 | #62 |
|
I am a engineering student as well as working in a web design and development company as a seo junior analyst.
|
|
Newbie Member
|
|
| 6Feb2010,19:36 | #63 |
|
Hi. I am an electronist ingeneer. I work as a mobile phones tehnician (gsm).
|
|
Newbie Member
|
|
| 11Feb2010,16:50 | #64 |
|
Hii Friends, I m doing BTech final year as CSE my branch
|
|
Skilled contributor
|
|
| 11Feb2010,21:25 | #65 |
|
Newbie Member
|
|
| 19Feb2010,17:21 | #66 |
|
I'm a student..
|
|
Newbie Member
|
|
| 19Feb2010,17:31 | #67 |
|
hi. i'm a student...pls help me to write a program..the problem is how can i display the even number in my text editor using c..i have a code in my text editor
hope u will help me.. Code:
#include<stdio.h>
#include<conio.h>
#include<bios.h>
#include<stdlib.h>
#include<string.h>
int locx,locy;
void line()
{
locx=wherex();
locy=wherey();
gotoxy(72,1);
printf("Ln %d:%d",locx,locy);
gotoxy(locx,locy);
}
int main()
{
textbackground(BLACK);
textcolor(WHITE);
FILE *f1;
int a,b,i,j,x1,y1,x2,y2,z=0,x3,y3,x=1,y=3,d;
char c,s[1600],fi[20]={" FileName"};
char in[5]={"Off"};
char str[25][80],str1[25][80],str2[25][80];
char *f;
clrscr();
for(i=0;i<25;i++)
for(j=0;j<80;j++)
str[i][j]=' ';
for(i=0;i<25;i++)
for(j=0;j<80;j++)
str1[i][j]=' ';
for(i=0;i<25;i++)
for(j=0;j<80;j++)
str2[i][j]=' ';
gotoxy(x,y);line();
while(1)
{
gotoxy(1,2);
d=205;
for(i=1;i<80;i++)
{
printf("%c",d);
}
//line();
gotoxy(1,1);
printf("%s",fi);
gotoxy(20,1);
// printf("NOTEPAD");
gotoxy(27,1);
printf("F1=Menu");
gotoxy(45,1);
printf("ESC=Exit");
gotoxy(55,1);
printf("INS=");
printf("%s",in);
gotoxy(x,y);
a=getch();
if(a==0)
{
b=getch();
b=b+100;
a=b;
}
switch(a)
{
case 172: //ARROW UP
if(y!=3)
gotoxy(x,--y);line();
break;
case 180: //ARROW DOWN
if(y!=25)
gotoxy(x,++y);line();
break;
case 175: //ARROW LEFT
if(x!=1)
gotoxy(--x,y);
else if(y!=3)
{
x=80;
gotoxy(x,--y);
}
line();
break;
case 177: //ARROW RIGHT
if(x!=80)
gotoxy(++x,y);//line();
else if(y!=25)
{
x=1;
gotoxy(x,++y);//line();
}
line();
break;
case 27: //EXIT
exit(1);
case 13: //ENTER KEY
x=1;
gotoxy(x,++y);
break;
case 182: //INSERT KEY
if(!strcmp(in,"On "))
strcpy(in,"Off");
else
strcpy(in,"On ");
case 8: //BACK SPACE
for(i=x-1;i<79;i++)
str[y][i]=str[y][i+1];
str[y][i]=' ';
gotoxy(--x,y);
line();
for(i=x;i<79;i++)
printf("%c",str[y][i]);
gotoxy(x,y);
break;
case 159: // F1
clrscr();
gotoxy(15,4);
printf("F2= New");
gotoxy(15,5);
printf("F3= Open");
gotoxy(15,6);
printf("F4= Save");
gotoxy(15,7);
printf("F5= Save as");
gotoxy(15,8);
printf("X = Back");
gotoxy(80,25);
break;
case 160: //F2
clrscr();
for(i=0;i<25;i++)
for(j=0;j<80;j++)
str[i][j]=' ';
strcpy(fi,"Untitled");
break;
case 163: //F5
clrscr();
gotoxy(1,10);
printf("Enter the filename to be saved:");
scanf("%s",f);
strcpy(fi,f);
f1=fopen(f,"w");
for(i=0;i<25;i++)
for(j=0;j<80;j++)
fputc(str[i][j],f1);
fclose(f1);
clrscr();
gotoxy(1,1);
for(i=1;i<25;i++)
for(j=1;j<80;j++)
{
gotoxy(j,i);
printf("%c",str[i][j]);
}
break;
case 161: //F3
clrscr();
gotoxy(1,12);
printf("Enter the filename to be opened:");
scanf("%s",f);
strcpy(fi,f);
f1=fopen(f,"r");
for(i=0;i<25;i++)
for(j=0;j<80;j++)
str1[i][j]=fgetc(f1);
clrscr();
gotoxy(1,1);
for(i=1;i<25;i++)
for(j=1;j<80;j++)
{
gotoxy(j,i);
str[i][j]=str1[i][j];
printf("%c",str1[i][j]);
}
break;
case 162: //F4
f1=fopen(f,"w");
for(i=0;i<25;i++)
for(j=0;j<80;j++)
fputc(str[i][j],f1);
fclose(f1);
clrscr();
gotoxy(1,1);
for(i=1;i<25;i++)
for(j=1;j<80;j++)
{
gotoxy(j,i);
printf("%c",str[i][j]);
}
break;
case 120: // x <---exit
clrscr();
gotoxy(1,1);
for(i=1;i<25;i++)
for(j=1;j<80;j++)
{
gotoxy(j,i);
printf("%c",str[i][j]);
}
break;
default:
c=a;
if(!strcmp(in,"On "))
{
i=y;
for(j=x;j<80;j++)
{
gotoxy(j+1,i);
printf("%c",str[i][j]);
str1[i][j+1]=str[i][j];
}
i=y;
for(j=x+1;j<80;j++)
str[i][j]=str1[i][j];
}
gotoxy(x,y);
printf("%c",c);
str[y][x]=c;
x++;
if(x==80)
{
x=0;
++y;
}
line();
}
}}
|
|
Newbie Member
|
|
| 19Feb2010,19:06 | #68 |
|
I am studying in IInd year IT diploma polytechnic
and i want to become a software engineer.. ![]()
|
|
Light Poster
|
|
| 23Feb2010,19:57 | #69 |
|
i am a student in kenya
|
|
Light Poster
|
|
| 23Feb2010,20:02 | #70 |
|
please provide me with examples of short programs where i can use loops
|


