The pointer which can point or access whole the residence memory of RAM i.e. which can access all 16 segments is known as far pointer.
Size of far pointer is 4 byte or 32 bit. Examples:
(1) What will be output of following c program?
int main(){
int x=10;
int far *ptr;
ptr=&x;
printf("%d",sizeof ptr);
return 0;
}
Output: 4
(2)What will be output of following c program?
int main(){
int far *near*ptr;
printf("%d %d",sizeof(ptr) ,sizeof(*ptr));
return 0;
}
Output: 4 2
Explanation: ptr is far pointer while *ptr is near pointer.
(3)What will be output of following c program?
int main(){
int far *p,far *q;
printf("%d %d",sizeof(p) ,sizeof(q));
}
Output: 4 4
First 16 bit stores: Segment number
Next 16 bit stores: Offset address
Example:
int main(){
int x=100;
int far *ptr;
ptr=&x;
printf("%Fp",ptr);
return 0;
}
Output: 8FD8:FFF4
Here 8FD8 is segment address and FFF4 is offset address in hexadecimal number format.
Note: %Fp is used for print offset and segment address of pointer in printf function in hexadecimal number format.
In the header file dos.h there are three macro functions to get the offset address and segment address from far pointer and vice versa.
1. FP_OFF(): To get offset address from far address.
2. FP_SEG(): To get segment address from far address.
3. MK_FP(): To make far address from segment and offset address.
Examples:
(1)What will be output of following c program?
#include "dos.h"
int main(){
int i=25;
int far*ptr=&i;
printf("%X %X",FP_SEG(ptr),FP_OFF(ptr));
}
Output: Any segment and offset address in hexadecimal number format respectively.
(2)What will be output of following c program?
#include "dos.h"
int main(){
int i=25;
int far*ptr=&i;
unsigned int s,o;
s=FP_SEG(ptr);
o=FP_OFF(ptr);
printf("%Fp",MK_FP(s,o));
return 0;
}
Output: 8FD9:FFF4 (Assume)
Note: We cannot guess what will be offset address; segment address and far address of any far pointer .These address are decided by operating system.
Limitation of far pointer:
We cannot change or modify the segment address of given far address by applying any arithmetic operation on it. That is by using arithmetic operator we cannot jump from one segment to other segment. If you will increment the far address beyond the maximum value of its offset address instead of incrementing segment address it will repeat its offset address in cyclic order.
Example:
(q)What will be output of following c program?
int main(){
int i;
char far *ptr=(char *)0xB800FFFA;
for(i=0;i<=10;i++){
printf("%Fp \n",ptr);
ptr++;
}
return 0;
}
Output:
B800:FFFA
B800:FFFB
B800:FFFC
B800:FFFD
B800:FFFE
B800:FFFF
B800:0000
B800:0001
B800:0002
B800:0003
B800:0004
This property of far pointer is called cyclic nature of far pointer within same segment.
Important points about far pointer:
1. Far pointer compares both offset address and segment address with relational operators.
Examples:
(1)What will be output of following c program?
int main(){
int far *p=(int *)0X70230000;
int far *q=(int *)0XB0210000;
if(p==q)
printf("Both pointers are equal");
else
printf("Both pointers are not equal");
return 0;
}
Output: Both pointers are not equal
(2)What will be output of following c program?
int main(){
int far *p=(int *)0X70230000;
int far *q=(int *)0XB0210000;
int near *x,near*y;
x=(int near *)p;
y=(int near *)q;
if(x==y)
printf("Both pointer are equal");
else
printf("Both pointer are not equal");
return 0;
}
Output: Both pointers are equal
2. Far pointer doesn’t normalize.
257 comments:
1 – 200 of 257 Newer› Newest»great job!!
Making a C program, to record the subjects taken by a student, the subjects removed, the approved and disapproved and calculate the GPA for that semester.
The program should have the option of "going out"
Superb collection..thanks !!
just one bug to notify in Q.14..printf("Size of structure is: %d",*ptr); *ptr should be changed to ptr
Question 14 is correct one. No bug. It will work only Turbo c3.0
woov very good post.. thanks a lot to author...
superr collectionnnnnnn.............
great job what a super collectionnnnnnnnnnnn
i want a c program that will display this output:
A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
Wonderful site.The effort of the site-creator is commendable.Keep it up.Your info. was quite useful.
great post!!
#include
void main()
{
int no_of_lines, alphabet = 65, i, count, j;
printf("\nenter the number of lines you want to print\t:");
scanf("%d",&no_of_lines);
count=2*no_of_lines;
for(j=0;j<no_of_lines;j++)
{
if(j==0)
{
printf("\n\n");
for(i=0;i<count;i++)
{
if(i<no_of_lines)
{
printf(" %c", alphabet++);
}
else if(i == no_of_lines)
{
alphabet--;
}
else
{
printf(" %c",--alphabet);
}
}
}
else
{
printf("\n");
//printf("\nnothing\n");
for(i=0;i<count-2*j;i++)
{
if(i<no_of_lines-j)
{
printf(" %c", alphabet++);
}
else
{
printf(" %c",--alphabet);
}
}
}
}
}
SAMPLE OUTPUT:
enter the number of lines you want to print : 5
A B C D E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
if u want dat particular format enter the number of lines as 7....
Great work ..Lots of hard work ...thanks a lot..becz it helps me a lot
main()
{
float a=0.7;
if(a<0.7)
printf("c");
else
printf("c++");
}
output:c
Can anybody explain this plz
Hi Anil,
Check the question(4) of following link
http://cquestionbank.blogspot.com/2010/04/c-questions-answers.html
I think It will help you.
main()
{
float a=0.7;
if(a<0.7)
printf("c");
else
printf("c++");
}
Exp:
in the above program the compiler take it('a') as 0.7000001,so a<0.7 i.e true.so ,it's o/p is "c".
its not enough to learn "c" need some more, this is very nice collection,thank full to you
void main()
{
int i;
char j;
for(i=71;i>=65;i--)
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
printf("\n");
}
output:-
ABCDEFG
ABCDEF
ABCDE
ABCD
ABC
AB
A
void main()
{
int i;
char j,k;
for(i=71;i>=65;i--)
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
for(k=i;k>=65;k--)
{
printf("%c",k);
}
printf("\n");
}
output:-
ABCDEFGFEDCBA
ABCDEFFEDCBA
ABCDEEDCBA
ABCDDCBA
ABCCBA
ABBA
AAA
C is a very interesting language and this is a basic of all language, if we have no knowledge of c then we cant understand c++, this is a 1st stage of all programing language.
Great! this post is very help for me.
Great work...really worthable one
awesum collection...
Awesome awesome awesome awesome awesome.......
really...helpful
awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome awesome xcllnt work..............:))))))
great post
good but need little more
all questions are very easy questions pls post difficult question and their answers
good
Thanks u vary much to create such super blog
thank you sooooooooooooooooooooooo much...i find these questions so very useful...i could now confidently face my placement interviews..thanks once again..
I need answer for this question immediately before 3 hrs .. pls help me
1.write a c program to divide the no. 73897869by 256 without using +,-,/,* and loop statement??
and this too!
write 2 main () independent functions without using comments in a single program..pls help me friends i need the answer the answer immediately
Wow....thats great. I have my Class Notes on C Programming. I shared them in my blog
Tanmay On Run
But your posts are much more helpful, My post will be helpful for class notes. But these posts are helpful for practicing. Nice to find your blog.
1)void main()
{
float a=2.1;
if(a==2.1)
printf("TE");
else
printf("BE");
getch();
}
------------------------------------------------------
Whats the OUTPUT of Following Program
2)void main()
{
float a=2.0;
if(a==2.0)
printf("TE");
else
printf("BE");
getch();
}
give Ans with reason....:)
Hi Anurag,
Please check the question (1) of the following link: http://cquestionbank.blogspot.com/2009/09/c-operator-question-with-detial.html
I hope it will help you.
thanks a lot sir..........
super..................site,&&&&&&&&&&&&&&&
super collection.
very very helpful, thank you!
excellent work
thanks............
supper.....D:)
i didnt even expect this much of material ..thanq :) i think it definitly helps me alot..:)
In the program for dangling pointer if ptr=call()
is written before clrscr() then it prints garbage value ...if written after it prints 26 correctly......Plz explain this..........using turbo C
good very good
Write a program for a GENERAL NUMBER CONVERTERS which include
binary, decimal, octa and hexadecimal. You need to write the program using C
language.
Hi,
I hope this link will help you
http://cquestionbank.blogspot.com/2010/07/c-program-examples.html
Check Conversion ( Number System ) section
well frnd i have a question---
why the constructor in c++ can't be virtual but destructor can be?
I really appreciate this. I shall donate some to this site.
This is very use full for students....
really good collection.....very useful
Anyone plz peast link to find turbo C for windows-7.
i have turboC.exe setup but not working properlly.
Count the total words in a sentence,count once if word repeatting without using lib function.
eg- my name is jawed,my pet name is dog.
Answer-6
all genius....
great work...
void main()
{
float a=2.1;
if(a==2.1)
printf("TE");
else
printf("BE");
getch();
}
In the above program a is float value but 2.1 value directly substituted in program taht value take double datatype.
-- float takes after dot(.) 8 zero's.
-- Double takes after dot(.) 16 zero's.
so.....float is not equal to double.
ans is BE.
write a program to find the rank of the number in the one dimensional array without using sorting and using two arrays
c++ has any site like c
nice job i didn't see this type of stuff .Why don't you make website, we will made website with low price consult us sankar00002009@gmail.com
yes. good
thanks
// This program is written in JAVA language .Which language u r using u can change
public class BB5
{
public static void main(String aa[])
{
int n=20;
int a=1;
int b=n/2;
int c=65+b;
for(int k=1;k<=(n/2+1);k++)
{
for(int i=65;i<=c;i++)
{
System.out.printf("%c",i);
}
for(int j=65+b;j>=65;j--)
{
System.out.printf("%c",j);
}
c--;
b--;
System.out.println();
}
}
}
#include
#include
void main()
{
int i,j;
clrscr();
for(i=9;i>=1;i++)
{
for(j=i-1;j<=i;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
I Think of your talents as the things you’re really good at. They’re like personality traits. For instance, you may be a very creative person, or a person who’s really good at attending to details or a person with a gift for communicating. Your talents are the base for any successful business venture, including a home-based business.
Excellent work . . .thank u
wonderful info abt C
information is very good
great job, really wonderful info.
yup the (0.7) in the if statement is by default double type
and float is always less as to double!!
so,float a=0.7 is always less than (0.7 which has it's default datatype double)!!
:-)
really very useful..thnks a lot
This is really an awesome blog!!!
Way to go!!!
Awesome! Awesome ! Awesome!
Thanks a lot. this helps a lot for fast revision of C.
*hi can u suggest me a good ebook for Recursion in C??
I cant understand recursion :(
plz help me out...
Shubharata, I hope this link will help you:
How to write function recursion program in easier way
it's is very useful..............
can u write a code of this output:
Enter a number:12345
:23451
:34512
:45123
:51234
The highest number:51234
and this..
Enter a length of line:5
Enter P1:maria
Enter P1:greg
Enter P1:juan
Enter P1:bitoy
Enter P1:melai
SAVE:4
I'LL wait ur reply.. i need it so badly
i need a program for this
1
2 3
4 5 6
7 8 9 10
#include
#include
void main()
{
printf("1
2 3
4 5 6
7 8 9 10");
getch();
}
without loops.......use \t for tabs
void main()
{
printf("1\n2 3\n4 5 6\n7 8 9 10");
}
hii frnds, i am starting to learn C programming language ....but it seems so difficult, i m studying "LET US C".It is very tuff to understand the concept of looping & Decision making questions...so frnds please me guideline how can i improve my learning....coz i want to make my carier in programming.
Please add some more question like..
1.Diff. btw c and c++,
2.Diff btw c++,C,java.
3.what is deceleration and definition.
Thank's for providing valuable information,it help's to me............
good site .create site gives information for c++,java,DBMS,unix
Thank you admin.
Kudos to the Blogger!
Keep up your good work.
#include
int main (){
unsigned int j;
unsigned char i;
for(j=0;j<7;j++){
for(i = 'a';i <= ('g' - j);i++)
printf("%c", i);
for(i = ('g' - j);i >= 'a';i--)
printf("%c", i);
printf("\r\n");
}
return ;
}
hey have you done programming using calloc and malloc?
I am not able to find out...plz tell me where it is?
above is right
void main()
{
int j,i,k;
k=1;
for(i=1;i<=4;i++)
{
for(j=i;j<=i;j++)
{
printf("%d",k);
k++;
}
printf("/n");
}
}
In the above program a is float value and 0.7 value directly substituted in program that value take double datatype.
-- float takes after dot(.) 8 zero's.
-- Double takes after dot(.) 16 zero's.
so.....float is always less than double.
Output of this program is C
thanks for your information...
They are useful everyone for developing career...
good work keep it up...
what is the output for following query:
1.select greatest(94,'845','846') from dual;
2.select greatest('94','845',846) from dual; can anyone explain me plz
// this is correct , just check it , run it
#include "stdio.h"
int main()
{
int j,i,k;
k=1;
for(i=1;i<=4;i++)
{
for(j=0;j<i;j++)
{
printf("%d ",k);
k++;
}
printf("\n");
}
return 0;
}
how to write a c program to find birth year by NIC number
hi frds i need ur help can anybody tell me the program for this algorithm??plz send to my mail id sasiviji95@gmail.com as soon as possible plz frds it's my request,,
write a c++ program to print the following triangle
5
4 5
3 4 5
2 3 4 5
1 2 3 4 5
algorithm:
s1:start the program
s2:
declare i,jand n as int data type
s3:read the number of lines
s4:fori=n to greater then or equal to 0
s4.1:for j=i to less than n print y
s5: stop the program
output:
enter number of lines 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
thanks a lot
#include
#include
char *
rotate(char *str)
{
char *cp = str;
char ch = *cp++;
int i;
while (*cp) {
*(cp-1) = *cp++;
}
*(cp-1) = ch;
return str;
}
void
shuffle(char *str)
{
long bigval = 0;
int i;
long val = 0;
printf("Shuffling...\n");
for (i=0; i < strlen(str); i++) {
printf("%s\n", str = rotate(str));
val = atol(str);
if (!bigval || val > bigval ) {
bigval = val;
}
}
printf("Biggest shuffle is %d\n", bigval);
}
main()
{
char buf[64];
printf("\nEnter +ve number : ");
scanf("%s",&buf);
shuffle(buf);
}
best site i ever user..
plz type the program this output display in c lang
your blog is soo use full and ur c skills are awesm :)
Pass by reference is NOT possible in C.
The program will work however its not an example of "pass by reference"
IN the 10th question........where is const variable???
int main(){
float a=0.0f,b=1.0f,c=2.0f;
float * arr[]={&a,&b,&c}; // ************
b=a+c;
printf("%f",arr[1]);
return 0;
}
hy this is producing an error :Illegal Initialization I have marked that line by ******.......
Plz help
What is difference between dequeue and deque?
/*This program written in C Language*/
#include
main()
{
char i,j,k;
for(i='G';i>='A';i--)
{
for(j='A';j<=i;j++)
{
printf("%c",j);
}
for(k=i;k>='A';k--)
{
printf("%c",k);
}
printf("\n");
}
}
Please make a program to reverse the string "MY NAME IS KHAN" to "KHAN IS MY NAME".
what is memory representation of 5.235!!!!!!
where is the answers????????????
good good,thanxxxxxxxxxxxxxxx
the way you explain in q17 is awesome I hve ever read.. :)
#include
int main()
{
int a,n=7,i,c;
for(i=0;i<=n;i++)
{for(c=0;c<=(n-i);c++)
printf(" ");
for(c=0,a=65;c<=i;c++,a++)
printf("%c",a);
printf("\n");
}
n++;
for(i=n;i<=16;i++)
{
for(c=0;c<=n-i;c++)
printf(" ");
for(c=0,a=65;c<=(2*n-i);c++,a++)
printf("%c",a);
printf("\n");
}
return 0;
}
out put is :
A
A B
A B C
A B C D
A B C D E
A B C D
A B C
A B
A
void main()
{
int i=30;
int j=40;
printf("%d..%d");
getch();
}
output- 40..30
plz tell m logic used in this prog.
yeah man this is it all you need good work
awesome !! great explanation !!!!! very thanq sir :)
your blog is soo use full and ur c skills are awesm :)
hello frnds
any logic bits are there
plz tell me
help me
write a program in c input 1 and the output 100 anybody rly me pls
setup an internet connection and share this connection using proxy server with limited service that is only HTTP and FTP? please friends answer the quetion............
Write a "C" programe to show weekday when input 1 show Monday 2 tuesday as show on using the switch statement? give me answer the que..........
What is the output of the following code segment?
int i=1;
do
while(i++<=5);
while(i++<=4);
while(i++<=3);
printf(“%d”,i);
What is the output of the following code segment?
int i=1;
while(i++<5);
printf("%d",i);
superb...................
Thank you! Good questions.
#include
#include
#include
void arraydivide(char a[])
{
int i,j,k,l,length;
length=strlen(a);
for(i=length-1;i>=0;i--)
{
for(j=0;j<=i;j++)
{
printf("%c",a[j]);
}
if(i==length-1)
for(k=i-1;k>=0;k--)
{
printf("%c",a[k]);
}
else
{
for(l=i;l>=0;l--)
{
printf("%c",a[l]);
}
}
printf("\n");
}
}
void main()
{
char a[]={"ABCDEFG"};
clrscr();
arraydivide(a);
getch();
}
can u pls help me to get output in dis format and also explain them
#
# # #
# # # # #
# # # # # # #
#include /* it's in c language*/
int main()
{
int lines,i,j;
scanf("%d",&lines); /** the number of lines that you need*/
for(i=0; i<lines; i++)
{
printf("#");
for(j=0; j<i; j++)
printf("##");
printf("\n");
}
return 0;
}
superb
Its written in c...
#include
#include
int main(){
char ch,comp;
comp='G';
int i;
for(i=0;i<7;i++){
ch=65;
while(ch<=comp){
printf("%2c",ch++);
}
if(ch=='H'){
ch=ch-2;
}
else{
ch--;
}
while(ch>=65){
printf("%2c",ch--);
}
comp--;
printf("\n");}
getch();
return(0);
}
too good site
Array of pointers in c:
Array whose content is address of another variable is known as array pointers. For example:
int main(){
float a=0.0f,b=1.0f,c=2.0f;
float * arr[]={&a,&b,&c};
b=a+c;
printf("%f",arr[1]); not this // here Printf("%f",*arr[1]); this is true sentence
return 0;
}
10)
Write a c program to modify the constant variable in c?
Explanation:
You can modify constant variable with the help of pointers. For example:
#include
int main(){
int i=10;
int *ptr=&i;
*ptr=(int *)20;
printf("%d",i);
return 0;
}
Output: 20
MISTAKE :: *ptr=(int)20;
mistke is in 7th answer
mistake :: Q--12 A--12
printf("Size of structure is: %d",*ptr); //this st. provide address of the value not actual value
true statement is :: printf("Size of stucture is: %d",ptr); // this st. provide actual value
printf("%f",*arr[1]);
constant variable means not const it's just member variable which hold some specific value.
and u thing the const, we cant change its value accept help of hardware time.
u can use pointer of multiple array. using this feature u can build your program what u want.
how we can print N*N matrix without using an array
int main()
{
int a=15;
a=(++a)+015+0x15;
printf("%d",a);
return 1;
}
i don't know how to work octal and hex hear so plz tell me what is o/p with explanation of that prog.
if u can u get all the answer for above question ill be very thankfull for the one
Q) Write a program to identify keyword in 'c'
sample input: for
sample output: this is keyword
sample input: why
sample output: this is not keyword
guys code for
Input: 12/02/1993
Output: 12-feb-1993
int i,j;
for(i=5;i>0;i--)
{
for(j=0;j<=(5-i);j++)
{
printf("%d",j+i);
}
printf("\n");
}
thank you... such a nice collection. keep it up..
c program for merging two arrays into a single array alternatively:
sample Input:
a[]=1,2,3,4
b[]=a,b,c,d
sample output:
1,a,2,b,3,c,4,d
1
12
123
1234
it was good material to the freshers
it prints 1
plz solve this problem through while and for loop
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
plz help me
plz help me
write a programm to draw w shap by using height=5,width=2 in c or java
\ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \
sorry above shape is not correct. print w shape
i want a c program to
print the following pattern
1 2 4 7
2 5 8 11
6 9 12 14
10 13 15 16
i want a c program to
Find whether the given word can be converted into palindrome or not
Ex : 1
Input : tests
It can be converted into tsest or stets
Output : Yes
Ex : 2
Input : arm
Output : No
please help me as soon as possible
*
* *
* * *
* * * *
* * *
* *
*
i want a this output's program
thanks a lot
i need program for following
a
as
asp
aspi
aspir
aspire
I want to know the answer
C programming Using nested loop
Input n=3
output:
S1: 1!+2!+3!+........+n!=9
S2: 1!+3!+5!+........+(2n-1)!=127
S3: 2!+4!+6!+........+2n!=736
How can i understand patterns in c programming......
*
**
***
****
Create a program to calculate the salary and bonus based on sales of a staff.
(i) In main() :
(ii) In function get_bonus(...) :
- Ask the user to enter satff id, salary and units sold.
- Call function get_bonus(...) and pass units sold and salary to calculate
the bonus amount.
- Call function get_nett_salary(...) and pass salary and bonus amount to
calculate the nett salary.
- Call function display(...) and pass staff id, salary, units sold, bonus
amount and nett salary to be displayed on screen.
- get the units sold and salary from main() to calculate the bonus amount
by refering to the following table.
- return the bonus amount to main().
UNITS SOLD BONUS
> 1000 20% of salary
501 - 1000 10% of salary
(ii) In function get_nett_salary(...) :
(iv) In function display(...)
- get the bonus amount and salary from main() to calculate the nett salary.
- return the nett salary to main()
- get staff id, salary, units sold, bonus amount and nett salary from main.
- display all information on screen.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DATA ENTRY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter staff id : 1234
Enter staff salary : RM 3500.00
Enter total units sold : 750
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SALARY SLIP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Staff ID : 1234
Staff salary : RM 3500.00
Units sold : 750
Bonus : RM 350.00
Nett Salary : RM 3850.00
Press any key to continue
can someone help me with this question?
Wrote a program that take a integer number as input from user then reverse the number and show which grade it belongs to simple input : 18 output : 81 At please give me answer.
Very nice post , many things to learn from this, But very small correction required in 20th questions output part. It says: Range of unsigned char is -128 to 127. It should be Range of signed char is -128 to 127.Please change the unsigned to signed .
m.nagaraju
this is the sim[ple solution for that program
#include
#include
void main()
{
int r,c;
for(r=1;r<=5;r++)
{
for(c=1;c<=r;c++)
{
printf("#");
}
printf("\n");
}
getch();
}
above the all answres r exactly right
#include
#include
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
printf("#");
for(j=1;j<i;j++)
{
printf("##");
}
printf("\n");
}
getch();
}
i need tricky questions on pointers to salve;i need difficult questions
how can iprint 1-50 or 50-100 numbers in linux c program
by using if-else
the value of float a=0.7 will be 0.70000 .and we compare (0.70000<0.7)
condition satisfied so the answer is "c"
Very nice collection.. can u plz provide a program to print hello world without main() function..
I am not getting code for this pattern, can anyone of you can help me with this
the pattern is
D C B A
C B A
B A
A
I am getting o/p as
D B C A
D C B
D C
D
How to print
A
B C
D E F
G H I J
how to print pascal triangle exactly from the middle of screen......???all the lines shd B equidistant frm both the corners....
hello i have some question about what this reason of d and rep
long ppdp(long n)
{long d=2,rep=n;
if (n%2==0)
{rep=2;
}else {
d=3;
while (d*d<n && rep==n)
{if(n%d==0)
rep=d;
else
d+=2;
}
}
return rep;
}
char i, j;
for (i = 65; i<=70; i++)
{
printf ("\n");
for(j=65; j<=i; j++)
printf("%c", j);
}
return 0;
}
no>>9
Please update 12th question:
Explanation:
struct ABC{
int a;
float b;
char c;
};
int main(){
struct ABC *ptr=(struct ABC *)0;
ptr++;
printf("Size of structure is: %d",*ptr);//=>original:Here we got error
printf("Size of structure is: %d",ptr);//=>new update
return 0;
}
Thank you
question 10;
output: 10
question 10;
output: 10
Write a C program using function that takes a string and a number between 0 and 9 as parameters, and displays the string that many times, and returns its length.
Write a C program to accept the names and marks of 7 students in 5 subjects. Print in descending order the rank list based on the average of the 5 subjects. Also print the name of the first ranker and his percentage.
This C Question & answers are very good.Please tell me how to download All PDF file.
#include
main()
{
int i,k;
for(i=5;i>0;i--)
{
for(k=i;k<=5;k++)
{
printf("%d",k);
}
printf("\n");
}
}
I want below pattern in C or Any Programming language
ABCCBA
AB BA
A A
AB BA
ABCCBA
#include
int main()
{
int n;
printf(¨enter n value¨);
scanf(¨%d¨,&n);
for(int i=1;i<=n;i++)
{
for int j=1;j<=i;j++)
{
printf(¨*¨);
}
printf(¨\n¨);
getch();
}
#include
int main()
{
char s[7]="aspire";
for(int i=0;i<7;i++)
{
for(int j=0;j<i;j++)
{
printf("%c",s);
}
printf("\n");
}
}
Using Divide and conquer technique,how can we evaluate the polynomial P(x)= a+bx+cx2+.....+ nxn at a given point x .
C Programming Tips And Tricks...
Vist This Link..
https://youtu.be/TBKVuM9W8RM
i need a program to find computer configuration
This blog awesome and i learn a lot about programming from here.The best thing about this blog is that you doing from beginning to experts level.
Love from
thankyou
Helpful
Helpful
Good job bro :) keep rocking...
tq for qns with answrs......
write a program to input a number and count the digits in it.use while loop and the program should work correctly for zero(0) also ?
#include
main()
{
int n,r,c;
printf("enter n...");
scanf("%d",&n);
for(r=1;r<=n;r++);
for(c=1;c<=n;c++)
printf("%d",c+r);
printf("\n");
}
Nice job!!
Very good explanation (even these things are not really "basic".
For Q.17-(4), I think there is a mistake.
int ( * ( * ptr ) [ 5 ] ) ( )
Your Answer:
ptr is a pointer to such array of size five which content are pointers to
such function which parameter is void and return type is int type data.
Should be:
ptr is a pointer to such array of size five which content are pointers to
such function which has undefined (variable) number of parameters and return type
is int type data.
Since : int Foo () is a function which takes an undefined (variable) number of
parameters. That is totally different from int Foo (void) which takes no parameter
and return type is int.
Post a Comment