void main()
{
int i=7;
printf("N= %*d",i,i);
}

Answers were Sorted based on User's Feedback



void main() { int i=7; printf("N= %*d",i,i); }..

Answer / pawanjha12

Its output would be 7,

"%*d"

here * symbol doesn't affect of operation of %d.

so 7 is set to value in variable i.

Is This Answer Correct ?    19 Yes 6 No

void main() { int i=7; printf("N= %*d",i,i); }..

Answer / munir

N= 7
Six space will be left and than 7 will be written..* is kind
of width...so if you put printf("N=$3d,i) than width will be
set as 3.
inshort * is kind used when setting up the width..

Is This Answer Correct ?    8 Yes 5 No

void main() { int i=7; printf("N= %*d",i,i); }..

Answer / vishal bhardwaj

it will display N= 7

Is This Answer Correct ?    1 Yes 1 No

void main() { int i=7; printf("N= %*d",i,i); }..

Answer / sansiri

N= 7




it doesnot consider the * symbol and the other i.

Is This Answer Correct ?    0 Yes 0 No

void main() { int i=7; printf("N= %*d",i,i); }..

Answer / rohit kiran

The Output is:
N=7

Is This Answer Correct ?    2 Yes 3 No

void main() { int i=7; printf("N= %*d",i,i); }..

Answer / sapna

garbage value

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More C C++ Errors Interview Questions

printy(a=3,a=2)

3 Answers  


Answering Yes or No in C++...using only stdio.h and conio.h..........help me please...? here's must be the output of the program: Screen A Exam No. items Score 1 20 20 2 35 35 Another Entry? [Y] or [N] : Screen B: Record No. Student's Name: 1 Fernando Torres 2 Chuck Norris Note: if you press Y, the program must repeat the procedure in screen A, then if N, the program must proceed to the screen B....Please Help me out............

1 Answers  


#include<iostream.h> #include<stdlib.h> static int n=0; class account { int age,accno; float amt; char name[20]; public: friend void accinfo(account [] ,int); void create(); void balenq(); void deposite(); void withdrawal(); void transaction(account []); }; void account :: create() { static int acc=1231; accno=acc+n; cout<<"\n\tENTER THE CUSTOMER NAME : "; cin>>name; cout<<"\n\t ENTER THE AGE : "; cin>>age; cout<<"\n\t ENTER THE AMOUNT : "; cin>>amt; // if(amt<=500) // cout<<"\n\tAMOUNT IS NOT SUFFICIENT TO CREATE AN ACCOUNT..."; cout<<"\n\t YOUR ACCOUNT NUMBER : "<<accno<<endl; n++; } void accinfo(account cus[],int ch) { int no,flag=0; cout<<"\n\t\tENTER YOUR ACCOUNT NUMBER : "; cin>>no; for(int i=0;i<=n&&flag==0;i++) if(no==cus[i].accno) { flag=1; switch(ch) { case 2: cus[i].balenq(); break; case 3: cus[i].deposite(); break; case 4: cus[i].withdrawal(); break; case 5: cus[i].transaction(cus); break; default: cout<<"\n\t\tEND OF THE OPERATION"; exit(1); } } if(flag==0) cout<<"\n\t\tYOUR ACCOUNT DOES NOT EXIST..."<<endl; } void account :: balenq() { cout<<"\n\t\tCUSTOMER NAME : "<< name << endl; cout<<"\n\t\tBALANCE : "<< amt << endl; } void account :: deposite() { int damt; cout<<"\n\t\tCUSTOMER NAME : "<< name <<endl; cout<<"\n\t\tBALANCE : "<< amt <<endl; cout<<"\n\tENTER THE AMOUNT TO BE DEPOSITED : "; cin>>damt; amt+=damt; cout<<"\n\t\tYOUR CURRENT BALANCE : "<<amt<<endl; } void account :: withdrawal() { int wamt; cout<<"\n\t\tCUSTOMER NAME : "<< name; cout<<"\n\t\tBALANCE : "<< amt; cout<<"\n\tENTER THE AMOUNT TO BE WITHDRAWN : "; cin>>wamt; if(amt-wamt>=500) { amt-=wamt; cout<<"\n\t\tYOUR CURRENT BALANCE : "<<amt; } else cout<<"\n\tYOUR BALANCE IS TOO LOW FOR WITHDRAWAL..."<<endl; } void account :: transaction (account cus[]) { int no,tamt,flag=0; cout<<"\n\tENTER THE RECEIVER'S ACCOUNT NUMBER : "; cin>>no; cout<<"\n\t\t ENTER THE AMOUNT : "; cin>>tamt; for(int i=0;i<=n&&flag==0;i++) if(cus[i].accno==no) { flag=1; cus[i].amt+=tamt; amt-=tamt; cout<<"\n\t\tYOUR CURRENT BALANCE : "<<amt<<endl; cout<<"\n\t\t RECEIVER'S BALANCE : "<<cus[i].amt<<endl; } if(flag==0) cout<<"\n\tRECEIVER'S ACCOUNT NUMBER IS NOT AVALIABLE..."<<endl; } void main() { account cus[10]; int ch; do { cout<<"\n\t\t BANK ACCOUNT"; cout<<"\n\t\t ************\n"; cout<<"\n\t\t1.CREATE AN ACCOUNT"; cout<<"\n\t\t2.BALANCE ENQUIRY"; cout<<"\n\t\t3.DEPOSITE"; cout<<"\n\t\t4.WITHDRAWAL"; cout<<"\n\t\t5.TRANSACTION"; cout<<"\n\t\t6.EXIT\n\n"; cout<<"\n\t\tENTER YOUR CHOICE : "; cin>>ch; if(ch==1) cus[n].create(); else accinfo(cus,ch); }while(1); }

1 Answers  


what is the large sustained error signal that eventually cause the controller output to drive to its limit

1 Answers   TCS,


write a profram for selection sort whats the error in it?

2 Answers  






Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor's notes: This problem requires either a while or a do-while loop.

3 Answers  


write the value of x and y after execution of the statements: int x=19,y; y=x++ + ++x; x++; y++;

0 Answers  


How to convert hexadecimal to binary using c language..

1 Answers   Bajaj, GAIL, Satyam, Zenqa,


Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?

2 Answers  


A sample program using data structure? what is file handling?

0 Answers   TCS,


Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .

2 Answers  


what is run time error?

7 Answers  


Categories