Question about Computers & Internet

1 Answer

C++ kindly find and debug this program #include #include void main() {char buffer[max]; clrscr(); ofstream out ("OUTPUT", ios::in|ios::out); if(!out) {cerr<<"Open failed\n"; exit(1); }cout<<"Enter a line of data:"; while(cin.get (buffer, max) == eof()) {put<<<< "Next line: "; } getch(); }

Posted by on

1 Answer

Good

Posted on Feb 23, 2008


1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

Write a program that accept a number and output its equivalent in words.


Below is the program written in Turbo C.

#include<stdio.h>
void pw(long,char[]);
char *one[]={" "," one"," two"," three"," four"," five"," six"," seven","
eight"," Nine"," ten"," eleven"," twelve"," thirteen"," fourteen","
fifteen"," sixteen"," seventeen"," eighteen"," nineteen"};
char *ten[]={" "," "," twenty"," thirty"," forty"," fifty"," sixty","
seventy"," eighty"," ninety"};

void main()
{
long n;
clrscr();
printf("
Enter any 9 digit no: ");
scanf("%9ld",&n);
if(n<=0)
printf("Enter numbers greater than 0");
else
{
pw((n/10000000),"crore");
pw(((n/100000)%100),"lakh");
pw(((n/1000)%100),"thousand");
pw(((n/100)%10),"hundred");
pw((n%100)," ");
}
getch();
}

void pw(long n,char ch[])
{
(n>19)?printf("%s %s ",ten[n/10],one[n%10]):printf("%s ",one[n]);
if(n)printf("%s ",ch);
}

Aug 06, 2010 | Borland Turbo C++ Suite 1.0...

1 Answer

Make a program that will accept tthe size of an array (number must be greater than). Enter and fill the array with numbers then sort in descending order (largest to smallest). Display the unsorted and...



coding in C++

#include<iostream.h>
#include<conio.h>
#define max 50

void main()
{
clrscr();
int arr[max],size=0;
int i=0,j=0,temp;
do
{
cout<<"Enter the size of array(less than or equal to 50)";
cin>>size;
} while(size>50);

for(i=0;i<size;i++){
cout<<"Enter a number";
cin>>arr[i];
}


for( i=1;i<size;i++){
for(j=0;j<size;j++){
if(arr[j+1]>arr[j]){
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;


}

}
}
cout<<”Array in descending order”;
for(i=0;i<size;i++){
cout<<arr[i]<<"\n";
}
getch();
return 0;
}

Mar 09, 2010 | Computers & Internet

1 Answer

I WANT THE WHOLE CODE FOR THIS


This whole code for above we can not give.

Aug 06, 2009 | Shopnovell iFolder 1.0 Software Media Kit...

1 Answer

Texture mapping problem


Here:
#include<stdio.h>
#include<conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <alloc.h>
///////////////////////////////////////////////// BMP format structures
typedef struct tagBITMAPFILEHEADER {
int bfType;
long bfSize;
int bfReserved1;
int bfReserved2;
long bfOffbits;
}BITMAPFILEHEADER;
typedef struct tagBITMAPINFOHEADER {
long biSize;
long biWidth;
long biHeight;
int biPlanes;
int biBitCount;
long biCompression;
long biSizeImage;
long biXPelsPerMeter;
long biYPelPerMeter;
long biClrUsed;
long biClrImportant;
} BITMAPINFOHEADER;
typedef struct tagRGBQUAD {
char rgbRed;
char rgbGreen;
char rgbBlue;
char rgbRserved;
} RGBQUAD;
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[256];
}BITMAPINFO;
///////////////////////////////////////////////// SVGA256 set functions
int huge p(void) { return(2); }
void setvideo()
{ int gdriver,gmode;
// gdriver=installuserdriver("svga256",p);
gdriver=DETECT;
initgraph(&gdriver,&gmode,"c:\\minc\\bgi");
}
///////////////////////////////////////////////// MAIN
void main(){
FILE *bmpfile;
BITMAPFILEHEADER bheader;
BITMAPINFO binfo;
char color, huge *buff;
long rest, width, i, j, k;
clrscr();
bmpfile=fopen("my.bmp", "rb");
// read info
fread(&bheader, sizeof(bheader), 1, bmpfile);
fread(&binfo, sizeof(binfo), 1, bmpfile);
fseek(bmpfile, bheader.bfOffbits, 0);
// picture width score
if(rest=binfo.bmiHeader.biWidth % 4)
width = binfo.bmiHeader.biWidth+ 4-rest;
else
width = binfo.bmiHeader.biWidth;
// from file to array (64K==MAX)
buff=(char far *)farmalloc(binfo.bmiHeader.biHeight*width);
k=0;
for(j=0; j<binfo.bmiHeader.biHeight; j++)
for(int i=0; i<width; i++){
fread(&color, sizeof(color), 1, bmpfile);
buff[k++]=color;
}

setvideo();
// set palette
for(i=0; i<256;i++)
setrgbpalette(i, binfo.bmiColors[i].rgbBlue>>2,
binfo.bmiColors[i].rgbGreen>>2,
binfo.bmiColors[i].rgbRed>>2
);
// drowing
k=0;
for(j=binfo.bmiHeader.biHeight; j>0; j--)
for(int i=0; i<width; i++){
putpixel(i, j, buff[k++]);
}
getch();
closegraph();

fclose(bmpfile);
}
Rate me please.

May 17, 2009 | Microsoft Visual Studio 2005 Standard...

1 Answer

Write a program in C to reverse each word at its own position in a string


HI..this is a program in C++..plz convert it to C by simply making some changes in the header files and cout, cin statements..

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
void main()
{clrscr();
char ch[100];
cout<<"\n Enter a Character: ";
gets(ch);
for(int length=0;ch[length]!='\0';length++);
for(int i=0,j=length;i!=j;i++,j--)
{char temp=ch[i];
ch[i]=ch[j];
ch[j]=temp;
}
cout<<"\n Reversed String: ";
puts(ch);
getch();
}

Mar 07, 2009 | Intel Pentium 4 505J Prescott 533MHz...

4 Answers

I need program source code for vertical redundancy check,longitudinal redundancy check,isochronous communication


#include<iostream.h>
#include<conio.h>

void main()
{
char bin[10],c;
clrscr();
cout<<"\n\n\n\nEnter 8 bit binary no.:";
cin>>bin;
cout<<endl;
for(int i=0;i<9;i++)
{
if(bin[i]=='1')
{
c++;

}


}
i++;

if(c%2==0)
{
bin[8]='0';
cout<<"Even";

}
else
{
bin[8]='1';
cout<<"Odd";
}
cout<<bin;
bin[9]='\0';
getch();
}

Feb 21, 2009 | Microsoft Windows XP Professional for PC

5 Answers

Source code for stack using arrays in c++


stack in c using arrays
/* Program of stack using array*/
#include

Dec 05, 2008 | Computers & Internet

1 Answer

C++ programming


I hope this helps.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()


{
clrscr();
char s[100];
int i,j,l,flag;
printf("\n enter a string:");
gets(s);
l = strlen(s);
j= l-1;
for(i=0;i<=j;i++,j--)


{
if(s[i]==s[j])


{
flag=1;
}
else
{ flag=0;
goto sar;
}
}
if(flag==1)


{
printf("\n string is palindrome");
}
else
sar:
printf("\n string is not a palindrome");
getch();
}

Sep 10, 2008 | Computers & Internet

1 Answer

Need code


Try the Following Five Programs

1) Program for Prime Number Generation

#include <stdio.h>
main()
{
int n,i=1,j,c;
clrscr();
printf("Enter Number Of Terms
");
printf("Prime Numbers Are Follwing
");
scanf("%d",&n);
while(i<=n)
{
c=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
c++;
}
if(c==2)
printf("%d ",i)
i++;
}
getch();
}
--------------------------------------------------------------------------------------------------------------------------------------------------

2)Program for finding the prime numbers

#include <stdio.h>
#include <conio.h>
void main()
{
int n,m,k,i,max;
char c;
clrscr();
repeat: max=0;
k=2;
n=1;
printf("You want prime numbers upto:- ");
scanf("%d",&max);
printf("

");
for (i=1;i<=max;i++)
{
again: m=(n/k)*k;
if (m!=n)
k=k+1;
else
goto try1;
if (k < n/2)
goto again;
else
printf("%d",n);
printf(" ");
try1: n=n+1;
k=2;
}
fflush(stdin);
printf ("

Do you want to continue?(y/n):- ");
scanf("%c",&c);
if (c=='y')
goto repeat;
getch();

}
---------------------------------------------------------------------------------------------------------------------------------------------------

3)
  1. #include <stdio.h>
  2. int main(void) {
  3. int n,
  4. lcv,
  5. flag; /* flag initially is 1 and becomes 0 if we determine that n
  6. is not a prime */
  7. printf("Enter value of N > ");
  8. scanf("%d", &n);
  9. for (lcv=2, flag=1; lcv <= (n / 2); lcv++) {
  10. if ((n % lcv) == 0) {
  11. if (flag)
  12. printf("The non-trivial factors of %d are: \n", n);
  13. flag = 0;
  14. printf("\t%d\n", lcv);
  15. }
  16. }
  17. if (flag)
  18. printf("%d is prime\n", n);
  19. }
---------------------------------------------------------------------------------------------------------------------------------------------------

4)

#include<stdio.h>

#include<conio.h>

void main()

{

int n,i,c=0;

clrscr();

printf("enter the number:");

scanf("%d",&n);

for(i=1;i<=n;i++)

{

if(n%i==0)

{

c=c+1;

}

}

if(c==2)

printf("number is prime");

else

printf("number is not prime");

getch();

}
-------------------------------------------------------------------------

5)
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the number:");
scanf("%d",&a);
for(b=2;b<a/2;b++)
{
if(n%i==0)
{
printf("\n Its not a Prime number");
c=1;
break;
}
if(flag==0)
printf("\n Its a Prime Number");
getch();
}
}


Sep 02, 2008 | Computers & Internet

2 Answers

C++ program


how to generate palindrome numbers through C++

Mar 21, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

65 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...