0
  • Forum > C - Program
  • Display Mode:

3/21/2007 12:41 PM C - Program (8 Comments)

dearfriendapds

C - Program

hello
all of you
i am a student . i have a problems .
send a c program of addition of two numbers with out using any brackets. please send me.

3/23/2007 10:25 PMRe: C - Program

Ash0Ray
ashraf 30, Beirut, Lebanon
put them in two variables then add them

3/23/2007 10:37 PMRe: C - Program

Ash0Ray
ashraf 30, Beirut, Lebanon

#include"stdio.h"
main ()
{int a,b,s;
printf(" enter 2 integers ");
scanf("%d%d",&a,&b);
s = a+b;
printf("%d",s);
return 0;
}

3/29/2007 7:14 AMRe: Re: C - Program

udaykanwarmusic
Uday 19, India
hi i am a also learning c. in the above commands why have u put return 0; after printf("%d",s);. I mean what does return 0;do and why is it needed because as it is we we havn't put it in a loop so why return 0. Is there no need to have clrscr(); before the int. Please reply to me asap.

4/10/2007 10:38 AMRe: Re: Re: C - Program

dearfriendapds
Ravi Kant 24, panipat, India
coz we haven't taken void main().
or
return 0 means it is not returning any value to the main function. if it was returning any value than we would have written int main() or any other way

4/11/2007 6:16 PMRe: Re: Re: Re: C - Program

braveheart007
BraveHeart 29, Ellar- Tulkarem, Palestine
clrscr(); used to clear the output screen .. if you want that then you have to include conio.h

4/11/2007 6:19 PMsee this in C++ Empty Rectangle

braveheart007
BraveHeart 29, Ellar- Tulkarem, Palestine
#include iostream.h
#include conio.h
#include iomanip.h
void main()
{
clrscr();
int l,w;
cout<<"L=";
cin>>w;
cout<<"W=";
cin>>l;
for(int i=1;i<=l;i++)
{
if((i==1)||(i==l))
{
for(int k=1;k<=w;k++)
cout<<"*";
cout< }
else
cout<<"*"<

}
getch();
}


check the signs in the header lines.. not allowed here

5/6/2007 9:44 PMRe: Re: Re: Re: C - Program

hunter498
ahmed 25, Tanta, Egypt
Regarding the return statment .. it's not a must to include it . and here's a link for you guys out there who wants to learn c programming .. www.cprogramming.com

11/23/2007 12:07 PMRe: C - Program

mariums1
marium 21, Karachi, Pakistan
hi
i want 8 queen puzzle solution
Post Your Comment
Subject:
Comment :