برامج

اسئله وبدها حل ( الامتحان قرب ) [الأرشيف] - برامج نت

المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : اسئله وبدها حل ( الامتحان قرب )


angel-palstine
05-23-2006, 08:43 PM
السلام عليكم

ساعدوني اخواني مشرفين منتدي المبرمجين ولغات البرمجه في حل الاسئله لانه قرب الامتحان

الاسئله هي


1- Which of the following represent valid variable definitions?

a) unsigned char *num = "276811";
b) char *name = "Peter Pan";
c) unsigned double d = 0.0;
d) signed char = -22222;

2-The function srand(void) return the type
a) char
b) float
c) integer
d) void

3- The function prototype of a function is given by:
int fun(int,float,char) ;
what type of arguments will the function take and what type of value will it return?
a) void
b) float
c) char
d) int

4- What is the difference between the following :
a) static variable
b) global variable

5- How will you declare a two-dimensional array of characters?

6- true or fals
1-a long integer will require 16 bytes for its storage
2-declaration static char c, and char c, are equivalent
3-There will be no semicolon at the end of the preprocessor directive
4-a pointer can point to another pointer
5-function fscanf() returns an integer number





7- What does the following code print:
main ( )
{
int arr[ ]={4,5,6};
int j, *ptr;
ptr=arr;
for(j=0; j<3; j++)
printf(“%d”,*ptr+j));
}

8- what will be the output of the following program:
#include <stdio.h>
int func(void);
main ( )
{
int j;
for(j=0; j<4; j++)
printf(“\nyou’ve called me %d times”, func( ));
}
int func(void) {
static int k;
return(++k);
}

9- Given the following definition of a ff() function

void ff (int x, int y)
{
int temp = x;
x = y;
y = temp;
}

what will be the value of x and y after the following call:

x = 10;
y = 20;
ff(x, y);

10-How many bytes will be required for storing samples declared as under:
union sample
{
char s[4];
int n;
}
union samlpe samples;

11- Write a program to read a line of text from the keyboard and write it to a file

الرجاء المساعده

am_tornado
05-25-2006, 12:54 AM
ممكن تستنى عليا ليوم السبت وأنا حساعدك إن شاء الله

JaVaFrEaK
05-26-2006, 06:33 AM
وعليكم السلام

1- Which of the following represent valid variable definitions?

a) unsigned char *num = "276811";
b) char *name = "Peter Pan";
c) unsigned double d = 0.0;
d) signed char = -22222;

2-The function srand(void) return the type
a) char
b) float
c) integer
d) void

3- The function prototype of a function is given by:
int fun(int,float,char) ;
what type of arguments will the function take and what type of value will it return?
a) void
b) float
c) char
d) int

4- What is the difference between the following :
a) static variable
return thier value inside the function they are defined
b) global variable
created by placing their valriable outside any function
5- How will you declare a two-dimensional array of characters?
char a[][];

6- true or fals
1-a long integer will require 16 bytes for its storage
ما بعرف
2-declaration static char c, and char c, are equivalent
false
3-There will be no semicolon at the end of the preprocessor directive
true
4-a pointer can point to another pointer
مابعرف
5-function fscanf() returns an integer number
مابعرف




7- What does the following code print:
main ( )
{
int arr[ ]={4,5,6};
int j, *ptr;
ptr=arr;
for(j=0; j<3; j++)
printf(“%d”,*ptr+j));
}
456
8- what will be the output of the following program:
#include <stdio.h>
int func(void);
main ( )
{
int j;
for(j=0; j<4; j++)
printf(“\nyou’ve called me %d times”, func( ));
}
int func(void) {
static int k;
return(++k);
}
you have called me 1 times
you have called me 2 times
you have called me 3 times
you have called me 4 times
9- Given the following definition of a ff() function

void ff (int x, int y)
{
int temp = x;
x = y;
y = temp;
}

what will be the value of x and y after the following call:

x = 10;
y = 20;
ff(x, y);
x =20
y =10
10-How many bytes will be required for storing samples declared as under:
union sample
{
char s[4];
int n;
}
union samlpe samples;
مش فاهم ولا حبه
11- Write a program to read a line of text from the keyboard and write it to a file
I don't know how to use C file processing

LaSer_26
05-26-2006, 06:46 AM
ايه هو السؤال وكمان عن أي لغه تتحدث؟

am_tornado
05-28-2006, 02:40 PM
دي لغه السي يا ليزر بس هيا شبيهه بالسي++ بس للأسف ماقريت عنها كتير

بالنسبه لآخر سؤال دا حلو




#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}

else cout << "Unable to open file";

return 0;
}

hamza_delphi
05-31-2006, 11:17 PM
بالنسبة للأسئلة
1-a long integer will require 16 bytes for its storage
false
2-declaration static char c, and char c, are equivalent
false
3-There will be no semicolon at the end of the preprocessor directive
true
4-a pointer can point to another pointer
true
5-function fscanf() returns an integer number
ما بعرف