≡ Menu

What does this sigmant print

You are Here: Home > Computer Subjects > Programming in C Language > …

What does this sigmant print?

     for (ch = (int) 'd'; ch < (int) 'n'; ch += 3)
           printf ("%c", (char) ch);
           printf ("\n");

Ans. Here the first line ch = (int) ‘d’; will assign the ascii value of ‘d’ into the variable ch, which is 100.
The second line, the condition section of the for loop, check the value of ch upto ‘n’ means 110.
And the third line indicates that the ch will increase its value by 3.

So the output of the above code will be-

d g j m

 

Click Here to Find Latest Jobs and Current Affairs

{ 0 comments… add one }

Leave a Comment