Learnem Educational
May 18, 2012, 12:40:26 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Exercize 1-7...  (Read 2176 times)
Anonymous
Guest
« on: June 03, 2002, 09:01:06 AM »

[code:t3iy32z9]#include<stdio.h>
main()
{
printf("I am going inside test function now\n");
test();
printf("\nNow I am back from test function\n");
}

test()
{
int a,b;
b=a+100;
printf("a is %d and b is %d",a,b);
}
[/code:t3iy32z9]

My problem is with the test() function. A and B are declared, B is set to A+100...but A is not initialized. In fact, I couldn't even compile the code. Any suggestions?
« Last Edit: January 01, 1970, 12:00:00 AM by Anonymous » Logged
Mr. Cool
Newbie
*
Posts: 11


View Profile
« Reply #1 on: August 16, 2002, 11:25:28 PM »

:wink:
« Last Edit: January 01, 1970, 12:00:00 AM by Mr. Cool » Logged
Anonymous
Guest
« Reply #2 on: August 30, 2002, 12:26:56 AM »

#include<stdio.h>

int test(void);

int main(void)
{
   printf("I am going inside test function now\n");
   test();
   printf("\nNow I am back from test function\n");
   return 0;
}

int test(void)
{
   int a = 0, b;
 
   b = a + 100;
   printf("a is %d and b is %d", a, b);
   return 0;
}

Here is your code :D
« Last Edit: January 01, 1970, 12:00:00 AM by Anonymous » Logged
Anonymous
Guest
« Reply #3 on: September 08, 2002, 08:32:32 AM »

Quote from: "TheNymph"
[code:i36y16q2]#include<stdio.h>
main()
{
printf("I am going inside test function now\n");
test();
printf("\nNow I am back from test function\n");
}

test()
{
int a,b;
a=1
b=a+100;
printf("a is %d and b is %d",a,b);
}
[/code:i36y16q2]

My problem is with the test() function. A and B are declared, B is set to A+100...but A is not initialized. In fact, I couldn't even compile the code. Any suggestions?
« Last Edit: January 01, 1970, 12:00:00 AM by Anonymous » Logged
Anonymous
Guest
« Reply #4 on: September 08, 2002, 08:34:56 AM »

Quote from: "sunlordsun"

[code:3mpiv91f]#include<stdio.h>
main()
{
printf("I am going inside test function now\n");
test();
printf("\nNow I am back from test function\n");
}

test()
{
int a,b;
a=1
b=a+100;
printf("a is %d and b is %d",a,b);
}
[/code:3mpiv91f]

My problem is with the test() function. A and B are declared, B is set to A+100...but A is not initialized. In fact, I couldn't even compile the code. Any suggestions? now you can compile and run program
[/quote]
« Last Edit: January 01, 1970, 12:00:00 AM by Anonymous » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!