0
ankit yadav's Avatar, Join Date: Feb 2010
Light Poster
student
0
jaikanth123's Avatar
Banned
I am a engineering student as well as working in a web design and development company as a seo junior analyst.
0
nicu81's Avatar, Join Date: Feb 2010
Newbie Member
Hi. I am an electronist ingeneer. I work as a mobile phones tehnician (gsm).
0
successvenki's Avatar, Join Date: Feb 2010
Newbie Member
Hii Friends, I m doing BTech final year as CSE my branch
0
senaratne's Avatar, Join Date: Jul 2008
Skilled contributor
Quote:
Originally Posted by successvenki View Post
Hii Friends, I m doing BTech final year as CSE my branch
Mmmmm. Happy to hear. Do some hard work and success is at your doorstep.
0
LanBie's Avatar, Join Date: Feb 2010
Newbie Member
Quote:
Originally Posted by Safari View Post
So, I thought it would be nice to get everyone a little more. What do you do in life? Student? Where do you work? I thought it might be nice to get to know each other a little.

I hope this thread would get good response and we can make this sticky as well.
I'm a student..
0
LanBie's Avatar, Join Date: Feb 2010
Newbie Member
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();

	}

    }}

Last edited by shabbir; 20Feb2010 at 10:00.. Reason: Code blocks
0
swapnilh's Avatar, Join Date: Feb 2010
Newbie Member
I am studying in IInd year IT diploma polytechnic
and i want to become a software engineer..
0
freakyjo's Avatar, Join Date: Feb 2010
Light Poster
i am a student in kenya
0
freakyjo's Avatar, Join Date: Feb 2010
Light Poster
please provide me with examples of short programs where i can use loops