[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Pointers - Discussion

Home > C Programming > Pointers > MCQs Questions Discussion

52 / 60

What is the output of the following 'C' program ?

#include<stdio.h>
void main()
{
 int i,count=0;
 char *p1="abcdefghij";
 char *p2="alcmenfoip";

 for(i=0;i<=strlen(p1);i++) {                                                                     
         if(*p1++ == *p2++)
   count+=5;
  else
   count-=3;
 }
 printf("count=%d\n",count);
}

A15

B6

C12

Dcompiler error

Answer: Option (Login/Signup)

Show Explanation

Asked In :: Global Edge

Post Your Answer Here:     

No Discussion on this question yet!