ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
How we print the table of 3 using for loop in c 
programing?
 Question Submitted By :: Rajesh Verma
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How we print the table of 3 using for loop in c programing?
Answer
# 1
int i;
for(i=1;i<=10;i++)
{
      i=i*3;
      printf("%d",i);
}
 
Is This Answer Correct ?    3 Yes 3 No
Chitra
 
  Re: How we print the table of 3 using for loop in c programing?
Answer
# 2
int i,no;
for(i=1;i<=10;i++)
{
      no=i*3;
      printf("%d",no);
}
 
Is This Answer Correct ?    5 Yes 0 No
Chitra
 
 
 
  Re: How we print the table of 3 using for loop in c programing?
Answer
# 3
for(i=1;i<=10&&printf("3*%d=%d",i,3*i);i++);
 
Is This Answer Correct ?    3 Yes 0 No
Teja
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }  1
main() { char a[4]="HELLO"; printf("%s",a); }  1
There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }  1
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique. Microsoft4
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }  1
Is the following code legal? typedef struct a { int x; aType *b; }aType  1
program to find the roots of a quadratic equation HP3
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }  1
how to delete an element in an array  1
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }  1
What is "far" and "near" pointers in "c"...?  3
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD Synergy6
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }  1
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); } main() { int a[10][10]; func1(a); func2(a); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above HCL1
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4 HCL1
main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above HCL1
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }  1
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }  1
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513 HCL1
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }  1
 
For more C Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com