Q BgQuestion:

      
Rookie
Karma Points: 0
Respect (97%):
posted by  RoOkie801 on 8/14/2009 11:02:36 PM  |  status: Closed  |  Earned Karma: 0

C Programming (1)

Course Textbook Chapter Problem Needs by
N/A N/A N/A N/A N/A
Question Details:
I need help building a program that performs the following operations:
.
1. Declares three pointer variables called iPtr of type int, cPtr of type char, and fFloat of type float.
.
2. Declares three new variables called iNumber of int type, fNumber of float type, and cCharacter of char type.
.
3. Assigns the address of each non-pointer variable to the matching pointer variable.
4. Prints the value of each non-pointer variable.
5. Prints the value of each pointer variable.
6. Prints the address of each non-pointer variable.
7. Prints the address of each pointer variable.
.
Thanks in advance.

AAnswers:

Answer Question Ask for clarification
Guru
Karma Points: 3,051
posted by masters on 8/15/2009 5:02:07 AM  |  status: Live
Asker's Rating: Lifesaver   
Response Details:
#include<stdio.h>
void main()
{
int * iPtr;                  
float *cPtr;
char * cChar ;
int iNumber;
float fNumber;
char cCharacter;
iPtr = & iNumber;
cPtr = & fNumber;
cChar = & cCharacter;
printf("\n the value of each non pointer variable is %d %f %c ", iNumber, fNumber,cCharacter);
printf("\n the value of pointer variable %s %s%s" , iPtr,cPtr, cChar);
printf("\n the address of non pointer variable %s%s%s",& iNumber,& fNumber,&cCharacte);
printf("\n the address of pointer variable %s%s%s",& iPtr,&cPtr, &cChar);
}

PLEASE RATE ME WELL HAVE A GOOD DAY!
Answer Question Ask for clarificarion

Join Cramster's Community

Cramster.com brings together students, educators and subject enthusiasts in an online study community. With around-the-clock expert help and a community of over 100,000 knowledgeable members, you can find the help you need, whenever you need it. Join for free today » How Cramster is different from tutoring »